Servername Weirdness

Mar 30, 2001

Hey folks,
Today's been way too much fun...
Someone changed the name of a machine in our department and now Win2k thinks the machine's name is (for example) "Fred", but if I do a select @@servername, SQL returns (again, for example) "Barney".

The machine's name started out as "Barney".

The last time this happened, it was on an NT4 box, and we just reinstalled sql and away we went.

This time, they reinstalled sql and released the box to the team, only to find out later that reinstalling sql didn't do squat this time.

Which brings me to the question: How do I convince SQL that it's really, truly supposed to be named "Fred"?
Besides that, what do I tell Wilma, Betty, Pebbles and Bamm Bamm?

Any assistance would be greatly appreciated.

: )

Thanks,

Tom

View 3 Replies


ADVERTISEMENT

Why @@servername Is Not Showing The Servername?

Feb 27, 2008



Hi

I have explicitly used
Exec SP_dropserver and
Exec SP_Addsserver SP's to drop and add a SQL server.

After that i restarted the sql server service. After that, when i used the query

select @@servername, it is returning NULL.
But, when I used Select Serverproprty('servername'), it is returning me the correct servername.
Can i know as why this behavior is exhibited for the same property of finding servername?

Thanks!

View 5 Replies View Related

Weirdness In .NET Sqlclient?

Mar 4, 2008

Hi All: I'm having problems creating a data connection between a windows 2000 server running .net 2.0 and a sql2005 server (server2003). I'm trying to create a connection in VWD2005 express, and when I use the visual wizard, I get a connection error with something about "named pipes" when I'm trying to connect using an alias on the server that uses tcp/ip (the alias is created in cliconfg).
If I click on "advanced properties" in the connection, and I select "TCP/IP" for the Network Library, what's displayed is "TCP/IP (DBMSGNET)" ...but shouldn't it say "DMBSSOCN"?
I'm wondering if this is correct, or a cosmetic bug in the .net sqlclient GUI, or indicative of any underlying problem that's preventing me from creating the connection?
If I manually override the connection string in web.config by entering "Network Library: DBMSSOCN", I still can't connect, getting a timeout error that the sql2005 server is not responding. But I know the server is working properly, with other .NET DB connections working within the same application...so I'm thinking this must be a problem with VWD and/or the .net framework on my local computer (not the server)?
I don't know where to begin to look to debug this problem?

View 2 Replies View Related

Inner Join Weirdness In DTS

Nov 23, 2005

I am trying to import data from Access 2000 in SQL Server 2000 usingDTS. One of the tasks requires a multi-table join but I am gettingsyntax errors if I generate the query with Build Query.With just a single join like this it works fine:FROM Tracker INNER JOINbdmanager ON Tracker.bdmanager = bdmanager.name,countryBut as soon as I get it to generate an extra join, e.g.FROM Tracker INNER JOINbdmanager ON Tracker.bdmanager = bdmanager.nameINNER JOINcountry ON Tracker.country = country.country.... I get "sytax error (missing operator)". The weird thing is that itgenerated the syntax itself!I can paste the query into Access and it works fine.Why is this happening and what's the best workaround?ThanksAndy

View 3 Replies View Related

Sqldatasource Weirdness On Postback

Jan 7, 2006

If I alter the SqlDataSource select command in code and then bind to a gridview, I run into problems. When I do a sort, next page (basically any postback), the datasource goes back to the original state. It is like the SqlDataSource is not maintained in the  state. I end up having to re-alter the SqlDataSource select command on every page_load. Is this by design or is this a bug?
Is the SqlDataSource any "smarter" than doing it the old fashion way by populating a Dataset on (!IsPostBack) ? For example, if I have a bunch of data in a paged gridview, is the SqlDataSource smart enough not to bother filling the entire dataset if I don't need it for that page's display?  I know the SqlDataSource provides for update/insert/delete, but I am not doing that in this application, it is just a query/report page.
Thanks in advance

View 4 Replies View Related

Stored Procedure Weirdness

Apr 15, 2008

I've been writing stored procedures for a while, but right now I'm stumped on something. I've got this one error when I try to use OPENROWSET in my stored procedure that tells me I need to set my ANSI_NULLS and ANSI_WARNINGS, so I put SET ANSI_NULLS ON GO SET ANSI_WARNINGS ON GO into my stored procedure, I clicked check syntax (this is all in enterprise manager), it was okay, I clicked okay, it told me I needed to set those things again, so I played around some more, deleted the SET ANSI's, adding them, deleting them, moving them around, and eventually it worked after I deleted them again.

Anyone know why this happens? Where exactly are my SET ANSI_NULLS supposed to go? As a workaround I've been simply running them in the query analyzer.

View 1 Replies View Related

Data Conversion Mapping Weirdness

Mar 4, 2008

Hi,

I have an Excel source > Data Conversion task > OLE DB Destination.

In the Data Conversion task I rename all the outputs to match the column names in my destination table.

However, when I go to map the columns in the OLE DB Destination mapping tab, it's a mess. Some fields are prefaced by "Data Conversion" as in "Data Conversion.column1", others are prefaced by "Excel Source" and others have no prefix at all.

What's confusing is, since all the columns are going through the Data Conversion task, how come I don't have ALL fields prefaced by "Data Conversion" ?

That is, only SOME of the fields have a "Data Conversion" prefix, and some don't. The ones that aren't prefaced by "Data Conversion" have no corresponding "Excel Source" so I'm assuming that the ones without the prefix are from the Data Conversion task.

It's inconsistent. Any ideas.

Thanks

View 3 Replies View Related

Major Query Optimiser Weirdness With UDFs And SPs On SQL 2000

Jul 20, 2005

There is something very strange going on here. Tested with ADO 2.7 andMSDE/2000. At first, things look quite sensible.You have a simple SQL query, let's sayselect * from mytab where col1 = 1234Now, let's write a simple VB program to do this query back to anMSDE/2000 database on our local machine. Effectively, we'llrs.open sSQLrs.closeand do that 1,000 times. We wont bother fetching the result set, itisn't important in this example.No problem. On my machine this takes around 1.6 seconds and modifyingthe code so that the column value in the where clause changes eachtime (i.e col1 = nnnn), doesn't make a substantial difference to thistime. Well, that all seems reasonable, so moving right along...Now we do it with a stored procedurecreate procedure proctest(@id int)asselect * from mytab where col1 = @idand we now find that executingproctest nnnn1,000 times takes around 1.6 seconds whether or not the argumentchanges. So far so good. No obvious saving, but then we wouldn'texpect any. The query is very simple, after all.Well, get to the point!Now create a table-returning UDFcreate function functest(@id int) returns table asreturn(select * from mytab where col1 = @id)try calling that 1,000 times asselect * from functest(nnnn)and we get around 5.5 seconds on my machine if the argument changes,otherwise 1.6 seconds if it remains the same for each call.Hmm, looks like the query plan is discarded if the argument changes.Well, that's fair enough I guess. UDFs might well be more expensive...gotta be careful about using them. It's odd that discarding the queryplan seems to be SO expensive, but hey, waddya expect?. (perhaps theUDF is completely rebuilt, who knows)last test, then. Create an SP that calls the UDFcreate procedure proctest1(@id int)asselect * from functest(@id)Ok, here's the $64,000 question. How long will this take if @idchanges each time. The raw UDF took 5.5 seconds, remember, so thisshould be slightly slower.But... IT IS NOT.. It takes 1.6 seconds whether or not @id changes.Somehow, the UDF becomes FOUR TIMES more efficient when wrapped in anSP.My theory, which I stress is not entirely scientific, goes somethinglike this:-I deduce that SQL Server decides to reuse the query plan in thiscircumstance but does NOT when the UDF is called directly. This iscounter-intuitive but it may be because SQL Server's query parser istuned for conventional SQL i.e it can saywell, I've gotselect * from mytab WHERE [something or other]and now I've gotselect * from mytab WHERE [something else]so I can probably re-use the query plan from last time. (I don't knowif it is this clever, but it does seem to know when twotextually-different queries have some degree of commonality)Whereas withselect * from UDF(arg1)andselect * from UDF(arg2)it goes... hmm, mebbe not.... I better not risk it.But withsp_something arg1andsp_something arg2it goes... yup, i'll just go call it... and because the SP was alreadycompiled, the internal call to the UDF already has a query plan.Anyway, that's the theory. For more complex UDFs, by the way, theperformance increase can be a lot more substantial. On a big complexUDF with a bunch of joins, I measured a tenfold increase inperformance just by wrapping it in an SP, as above.Obviously, wrapping a UDF in an SP isn't generally a good thing; theidea of UDFs is to allow the column list and where clause to filterthe rowset of the UDF, but if you are repeatedly calling the UDF withthe same where clause and column list, this will make it a *lot*faster.

View 3 Replies View Related

@@SERVERNAME

Jul 26, 2001

Folks !!

Select @@Servername results in 'NULL' !
For some reason, i can't get the name of the server !!1

Any Thoughts


Girish

View 4 Replies View Related

@@SERVERNAME

Jul 13, 1998

I am getting a null value when i am query the Global variable @@servername.

Please help !!
Thanks
vIVEk.

View 2 Replies View Related

Servername

Apr 9, 2002

hi!i can't find out the name of the sql2000-server witch is running not local.i know the username,password and i hear that "System-stored Procedure
" are the right one's. but i don't know how i do this. anyone else? thx robert

View 1 Replies View Related

@@servername

Nov 10, 2006

If anybody can explain why for one of my SQL Server2000 servers the statement select @@servername returns NULL instead of name?
Thanks

View 2 Replies View Related

Get The Old SQL Servername

Oct 11, 2007

I recall a method to get the old servername of a SQL server but old age has gotten to me.
I suspect a particular server has been renamed at one point. Obviously it wasn't me and the person before me is not around for me to ask.
So, can someone help an old guy out?

The results of print @@servername is NULL.

Thanks

View 2 Replies View Related

Problem With @@SERVERNAME!!!!

Nov 13, 2000

I want create replication through Create Publication Wizard . But I have
got error , that variable @@SERVERNAME is NULL!!!!!But I have my server
with NF5500 name! I query SELECT @@SERVERNAME. But I get NULL. I tried to use
SP_ADDSERVERNAME procedure to add server name, but I have got message that server with this name already exist. Please help me!!
Thanx in advance!!

View 2 Replies View Related

@@SERVERNAME Is NULL

Sep 27, 1999

Hello sir,

I have a probleme with a replication.
I have two servers (serv1 and serv2); when i want to install a replication from serv1 to serv2, i receive this message:
1->2:Replication cannot be installed as @@SERVERNAME is NULL.

from serv2 to serv1; I receive this message:
2->1:If Replication is uninstalled, all publications will be
eliminated and the distribution database[if it exist]will be
dropped. After the process has completed, this session will be
disconnected from the SQL Server. Do you want to unistall
replication?

Please advice me..

View 2 Replies View Related

@@servername Is NULL

Oct 19, 1998

On one of my SQL Servers I have noticed the @@servername to be NULL.

Any Idea how to give it back the original value. Simple
>> SELECT @@servername = `MY_SERVER_NAME` will not work since I can not update the global variable

This prevents from instaling publishing on that server, among other concerns for the overall stability of the server.

Help appreciated,

Bojan

View 1 Replies View Related

Getting Servername Inside XP

Jan 28, 2005

Hi :

Can anyone tell me if it is possible to get information like : servername/databasename inside an extended stored procedure ?

I checked the "srv_pfield" function but it only returns user/password information.

Thanks,
Rui

View 2 Replies View Related

Instance Name Vs Servername

Dec 29, 2007

Someone renamed a server from 2A to A.When I do @@servername I get 2A.The server/machine name is 2.Should my triggers say 2A or 2? Does it matter?Thanks

View 3 Replies View Related

Servername Missing, Please Help!

Dec 3, 2007



Please help:
when I want to create new data source from Data > Add New Data Source > Database > New Connection > Choose data sourse: MS Sql Server > Continue > Server name ----------> here in server name field i can see a lot of server names but not mine... so I'd like you to help me to find my server name...

thanks in advance!

View 8 Replies View Related

@@servername Returns NULL

Jul 23, 2005

I am trying to script out the creation of database scripts. I am tryingto use @@servername in the statement. I found out the select@@servername returns NULL. I used sp_dropserver to drop any servernamesfirst, restarted SQL, ran sp_addserver 'servername' to add theservername, restarted SQL. select @@servername still returns NULL...Any ideas why this may be happening?Thanks,TGru*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 2 Replies View Related

ServerName/Database Name Parameterization

May 24, 2006

I would like to parameterize the server name and database name in a query inside a stored procedure. I would like to avoid using the exec(@SqlCmd) technique if possible. HELP?

View 4 Replies View Related

Can Connect To 'ServerName' But Not To Its IP Address

Aug 4, 2006

I'm using SQL Manager from my Enterprise server to connect to my SQL Express server that will act as a witness to a db mirroring system. If I try to connect to the SQL Express server using its IP address, I get a "named pipes error 53." If I connect by browsing the network and connect to the Name of the Server "MachinenameSQLExpress", I am successful. I would like to be able to connect to the IP directly as it's not dependant upon certain services to be started or configured a certain way.

Thank you,


Chad

View 3 Replies View Related

Dynamically Change The Servername

May 10, 2006

Hi all,

I've created 1 solution and added all my packages in different projects (like DIMENSIONS, SOURCES_SAP, ...).

For each project I have a Data Source that connects to the server. The problem is that when I want to deploy a package to the server that I always need to change the Data Source before deployment.

Before SQL Server 2005 we used a connection file (which was located as well on the server as on the development pc's in the same locations) within our DTS packages. This way we didn't had to change the connections when deploying to the server.

My intention was to use the current configuration from the configuration manager(development / production) to select the servername. Unfortunately, I didn't succeed to retrieve it's value from a variable script.

I need to have a solution that dynamically changes the datasources for multiple packages depending on a specific action.

How can I achieve this the easiest way ?

Thanks in advance !

Geert

View 1 Replies View Related

@@servername Returns NULL Value

Mar 9, 2006

I have a SQL 2005 clustered server which is returning a Null value for @@servername. I find the server entry in sysservers. I have replication configured on this so i am not able to do a Sp_dropserver & sp_addserver as this acts as a publisher. The configured merge repication stopped working because of this issue and I am not able to delete replication as the the delete option uses @@servername which returns a null value. So I am struck in a loop.

Any advice is appreciated.



thanks

View 2 Replies View Related

@@servername Returning NULL

Mar 9, 2006

I have a SQL 2005 clustered server which is returning a Null value for @@servername. I find the server entry in sysservers. I have replication configured on this so i am not able to do a Sp_dropserver & sp_addserver as this acts as a publisher. The configured merge repication stopped working because of this issue and I am not able to delete replication as the the delete option uses @@servername which returns a null value. So I am struck in a loop.

Any advice is appreciated.



thanks

View 13 Replies View Related

Login Failed For 'servername/aspnet'

Jun 16, 2006

hi,
I am very new to asp.net..I am creating a webform which connects to sqlserver and  display table contents  to a grid control.When i run this form,i get error message as follows
Login failed for user 'SERVERNAME/ASPNET'.
I have read in one page of this forum that we should create aspnet user in sqlserver..i tried to create user,i can see 2 user Guest and public...I don't know what to do ?
If  someone replies my question,i would appreciate..I have struggling with this for the past 1 week..i couldn't find a solution.
My code  is as follows:
Dim MyConnection As SqlClient.SqlConnection
Dim MyCommand As SqlClient.SqlDataAdapter
Response.Write("hello world")
MyConnection = New SqlClient.SqlConnection("server=Localhost;Integrated Security=SSPI;uid=sa;password=;database=sample")
MyCommand = New SqlClient.SqlDataAdapter("select * from emp", MyConnection)
Dim ds = New DataSet
MyCommand.Fill(ds, "emp")
Response.Write("data set has been created")
DataGrid1.DataSource = ds.Tables("emp").DefaultView
DataGrid1.DataBind()
 thanks
kar

View 4 Replies View Related

Log In Failed For User '[servername]ASPNET'

Nov 14, 2003

can anyone help me with this error message, i follow the instruction of someone in other forum, but i cant find where the SQL Server Enterprise manager is, i am using MSDE.

View 2 Replies View Related

Upgrade Wizard @@servername = Null

Nov 22, 1999

Attempting Upgrade Wizard on PDC, SERVER1 NT4.0 sp5 SQLS6.5 sp5a

Master.db Syservers has 2 entries
1 SERVER1 SERVER1 ###s ###s - the PDC
2 SERVER2 SERVER2 null null - the SDC

when use sp_addserver, local get duplicate warning
when use sp_addserver, local, duplicates_ok completes (but no changes)

Is problem index associated with SERVER1 should be 0 not 1 ?
If so, would simply UPDATEing index from 1 to 0 fix problem ?

Thanks in advance

View 2 Replies View Related

How Do U Fix @@servername = NULL Without Restart SQL Server ?

Apr 27, 2004

@@servername sometimes returns NULL depending on how you have been messing around with replication and various other settings.

The simple solution offered to fix this is to delete the entries in the system tables and sp_addserver 'servername','local' and then restart the SQL service.

This is fine but what do you do in the situation where the SQL server is a 24/7 production box ? Does anyone know of a method / hack to fix this without stopping the service ?

Thanks

s

View 2 Replies View Related

Pass Linked ServerName To A Cursor Issue...

Jun 18, 2002

Need to loop through a Cursor to linked server:
-----------------------------------------------
Declare Cursor_Loop_serverName Cursor for
select cast(name as varchar(30)) name, cast(dbID as varchar(5)) dbID,
cast(crdate as varchar(25)) crdate
from ServerName_A.master.dbo.sysdatabases

***How could I pass @serverName to change the from to
from @RemoteServer.master.dbo.sysdatabases?
I have tried dynamic sql, it did not work after the Declare Cursor for...

thanks for the help
David

View 2 Replies View Related

Error: Unable To Connect To Server 'servername'

Apr 29, 2008

Hi,

I am trying to connect to SQL Server through Query Analyzer but getting following error: (SQL Server is at remote web server where i have my website hosted.)

Unable to connect to server [server IP]:

Server: Msg 6, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][dbnetlib] Specified SQL server not found.

I have searched this forum for this error and performed following workaround as suggested in some threads-

1. checked and set "TcpPort" registry setting.
2. TCP/IP is enabled in Network Utility.
3. "start SQL server if it is stoped" checkbox is unchecked while connecting.

But, I am still getting the above error. Should i re-installed SQL Server 2000? Any help?

Thanks,

View 3 Replies View Related

Unable To Create SERVERNAME/ASPNET Login

Jul 4, 2007

My system config is VISTA Ultimate, Visual Studio 2005 SP1, SQL SEVER 2005 SP2. Using 2005 SQL Server Management Studio I am unable to create a servername/aspnet login account.
I right click logins and get the new login form; key ASPNET Login Name; select Windows Authentication; click search; I get the Select User or Group form; under object type I select all three; location I select my server name; if I enter SERVERNAME/ASPNET and click Check Names I get an error; if I click Advanced and Find Now; ASPNET is not listed in Name(RDN) list.
I tried aspnet_sql.exe -E -A all; that did not work.
Where can I find information on creating an ASPNET Login after experiencing the above problems?

View 2 Replies View Related

Unable To Start T-SQL Debugging. Could Not Connect To Computer 'servername'.

Nov 9, 2007



I thought I would post how I got remote t-sql debugging working in my environment. Hope it might help someone.
I have two domains, DomainA and DomainB. DomainB has a one way external trust to DomainA. Dev Vista machine running VS 2005 is in DomainA logged in as user DomainAauser. SQL 2005 running on test Windows Server 2003 DC machine in DomainB under user DomainBuser. When trying to 'step into stored procedure' in VS, whether my data connection used windows authentication or sql server authentication, I would get the 'Unable to start T-SQL degbuggin...'. I could debug t-sql when I logged into the domain controller (console or rdp) and running VS on the server. I changed the SQL Server service to run under the DomainAauser account and I can now remote t-sql debug using both window authentication and sql server authentication. Hope this may help anyone that might run into this.

Regards,
RMcc

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved