April 17, 2005 at 8:02 am
Dear ALL,
I have inherited a server which shows following massage when I use 4 part table name.
My query is:
select sum(amount) AS Event
from MylocalServer.RA_P07.dbo.P07_C60A21_stage
Could not find server ' MylocalServer ' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
You cannot create a Local sql Server as a Link server
Muntasir
..Better Than Before...
April 18, 2005 at 7:54 am
Have you changed the name of the computer since installing SQL Server? I recall some sort of problem that you would have to drop the old computer name and add the new computer name somehow - but I don't know how... I do recall that it was more of a problem with SQL Server 7 than 2000 - but maybe this could be one of the problems?
April 18, 2005 at 7:55 am
I usually use TSQL scripts to create linked servers and I know that you can create one the "loops back" to the local server. I tend to use the machine name explicitly. If you aren't then that might be the problem you are having.
April 18, 2005 at 7:56 am
Try
USE master
GO
EXEC sp_addlinkedserver
@server='anyname',
@srvproduct='',
@provider='SQLOLEDB',
@datasrc='(local)'
GO
EXEC sp_addlinkedsrvlogin 'anyname', 'false', 'sa', 'Admin', NULL
go
select * from anyname.master.dbo.sysobjects
April 20, 2005 at 2:47 am
The master.dbo.sysservers holds the name of all SQL servers known to the local SQL Servers, including its own name. This srvname has srvid=0.
If you run the command:
select @@SERVERNAME
the result should be the name of the server, if this is not the case you can change this value by performing the following commands:
sp_dropserver @@SERVERNAME
GO
sp_addserver 'computername(\Instancename)', LOCAL
and restart the SQL Server.
The SQL Server inits the variable @@SERVERNAME when it starts so you have to restart the sql server every time you change the value of srvid=0 in master.dbo.sysservers.
You may run into problems if @@SERVERNAME is set wrong.
Regards Morten Baden Rohde
April 22, 2005 at 6:21 am
THX !!!
genius Newbie !!!
The Problem is solved......
It Is Working now
100000** 4 u
--Muntasir
..Better Than Before...
April 22, 2005 at 6:25 am
Old Hand Thx,
Though it does not solve my posted problem, but help me to think about add link server through TSQL insteed of Enterprose Manager 's GUI.
--Muntasir
..Better Than Before...
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply