October 3, 2003 at 6:26 am
I have to run queries against two databases on different servers (machines) in same Query Analyzer instance. Is there a way to do that.
Thanks.
October 3, 2003 at 6:29 am
Create a Linked Server on one server and refer to it in your query. See BOL for more info.
October 3, 2003 at 7:03 am
EXEC sp_addlinkedserver
@server='DTTAX2',
@srvproduct='',
@provider='SQLOLEDB',
@datasrc='QUSHAA06',
@catalog='DTTAX'
The above script I am using to add the remote server, and executes fine.
select * from DTTAX2.DTTAX.DBO.CTXACCT
The above select statement is used to query the database, but when I execute the above select I get following error.
Server: Msg 18456, Level 14, State 1, Line 1
Login failed for user 'sa'.
October 3, 2003 at 9:25 am
I got the access to the remote server.
Need to run the following proc to get authenticated on remote machine.
EXEC sp_addlinkedsrvlogin 'your linked server name', 'false', 'Login id on the local server', 'linked server login id to connect', 'linked server password'
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply