Accessing Linked Server in SQL Server 2000 (Urgent)
0 pts.
0
Q:
Accessing Linked Server in SQL Server 2000 (Urgent)
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.
ASKED: Mar 23 2005  10:47 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
0 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Hi All this is bakash again
The secon server is linkedserver. I missed '' in my previous question. Sorry
pls help thanks
Last Answered: Mar 23 2005  10:50 PM GMT by bakash   0 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

swede27410   0 pts.  |   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   0 pts.  |   Mar 24 2005  8:40AM GMT

check out openquery…

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

Me Linda

 
0