Pulling data from tables on different servers

120 pts.
Tags:
Linked SQL Servers
SQL Database
SQL error messages
I have a join between a table on my local database and a table on a different database on the same server. I reference the non-local database with DatabaseName.TableName. Now I find that the non-local database might be on a different server. I tried ServerName.DatabaseName.TableName, but I got this error: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Any idea how I can do this? Thanks.

COBill

ASKED: October 8, 2009  5:53 PM
UPDATED: October 12, 2009  7:58 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Your DBA of the remote server will need to setup a SQL login on the remote server, and setup a specific mapping for you (or for all users) so that when you try and connect to the remote server the connection logs into the remote server using the mapped SQL Account not your Windows account.

Using your Windows account to access a linked doesn’t work unless you are running the code from the first server’s console.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CO Bill
    Thanks. I contacted my DBA and am learning more about linked servers than I want to :-) CO Bill
    120 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following