Running query on a linked server

42 Views Asked by At

I have a local database server which has an associated sa account and on a cloud instance where we have another server I have added it to the local database server as a linked object. When I attempt to query on the database using the [LinkedServerName].[DatabaseName].dbo.[TableName] it is giving me an sa user login password. How can I join tables using tables from both databases if the sa accounts are different for each server

1

There are 1 best solutions below

0
LordBaconPants On

Assuming SQLServer, you can specify the user that the linked server is using. In SSMS, in the properties window for the linked server object, on the security page there is a checkbox for 'be made using this security context:' with a login and password box.

Put your remote server credentials in there and give that a try!