Question

  Asked: Mar 23 2005   10:47 PM GMT
  Asked by: bakash


Accessing Linked Server in SQL Server 2000 (Urgent)


SQL Server, Administration, Availability, Backup & recovery, Migration, Performance/Tuning, Security, Tech support, Standard Edition 2000, MySQL, Servers, SQL Server 2000, Identity & Access Management, Digital certificates, Single Signon, provisioning, Security tokens, Biometrics

I have a server named say 'SRVMAIN'. Using Enterprise Manager I added a linked server 'LNKDSRVR1' (existing server).
I m able to access any database in 'LNKDSRVR1' by writing a query in query analyzer of 'SRVMAIN' as
SELECT * FROM LNKDSRVR1.TESTDB.DBO.TESTTABLE

Now if I have server as 'linkedserver'. Again I added a linked server in 'SRVMAIN' as 'linkedserver'.
When I write a query as
SELECT * FROM linkedserver.TESTDB_new.DBO.TESTTABLE_new
I get an error message:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ''.
As linkedserver is an existing database, I cannot drop and rename it. It has huge amount of real data.
Pls help.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Hi All this is bakash again
The secon server is linkedserver. I missed '' in my previous question. Sorry
pls help thanks
  • AddThis Social Bookmark Button

Browse more Questions and Answers on SQL Server, DataCenter and Storage.

Looking for relevant SQL Server Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

swede27410  |   Mar 24 2005  7:59AM GMT

I think you problem is that your linkedserver name is linkedserver. The linkedserver name can be anything that you wish. Having special characters in the the name does not require it to be enclosed in brackets. The only time you need brackets is when you have spaces in the name. Our linked server names are in the form of servername_databasename (ex. server01_database01).

 

mejohnson  |   Mar 24 2005  8:40AM GMT

check out openquery…

SELECT * FROM openquery(LNKDSRVR1, ’select * from TESTDB.DBO.TESTTABLE) testtable

Me Linda