March 20, 2006 at 3:32 am
ok, im working on server a, the test server. server b is the production server. i have admin permissions on both servers. how , from server a do i select data from server b? i keep getting an error saying :
Msg 18456, Level 14, State 1, Line 1
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
how do i specify what login to use when logging into server b to get the required data?
March 20, 2006 at 3:40 am
Use the following Query :
SELECT a.*
FROM OPENROWSET('SQLOLEDB','<your serv_name>';'server_login';'password',
'your sql query ') AS a
Regards,
Amit Gupta.
March 20, 2006 at 3:47 am
keep getting this error
Msg 18452, Level 14, State 1, Line 1
Login failed for user EUROPE\v-fintag'. The user is not associated with a trusted SQL Server connection.
even though i know i have access to that server
SELECT
a.*
FROM
OPENROWSET('SQLOLEDB','eocopsit02';'EUROPE\rebsites
'
;'*********',
'selet * from goal ') AS a
this is exactly what i executed
March 20, 2006 at 3:48 am
keep getting this error
Msg 18452, Level 14, State 1, Line 1
Login failed for user EUROPE\v-fintag'. The user is not associated with a trusted SQL Server connection.
even though i know i have access to that server
SELECT
a.*
FROM
OPENROWSET('SQLOLEDB','eocopsit02';'EUROPE\v-fintag
'
;'*********',
'selet * from goal ') AS a
this is exactly what i executed
March 20, 2006 at 4:08 am
first try to connect direct to that server through
Query Analyser.
if it is not connected then you have to register the Sql Server.
You can do it by EM (Enterprise Manager)
Regards,
Amit Gupta.
March 20, 2006 at 7:36 am
You need to create a linked server connection between the two database servers. Then you will be able to work from one to the other.
Refer to the BOL for setting up linked servers.
-SQLBill
March 22, 2006 at 7:04 pm
The easiest ways is to query from Query Analyzer, with first connect to the server you want to query data.
The other ways, is to add linked server in your master database to be able to connect to the server you want to query data.
Like this :
--add the linked server
exec sp_addlinkedserver @server='MyLocalServer',
@srvproduct = 'SQLServer OLEDB Provider',
@provider = 'SQLOLEDB',
@datasrc = 'servername'
--query the data
select orderId, productId, quantity, unitprice
from MyLocalServer.northwind.dbo.[order details]
where orderid = 10250
thanks,
alexia
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply