I need some kind of book that will provide examples of querying linked data tables.
Your answer
Email me at this address if my answer is selected or commented on:Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
1 Answer
0 votes
Hi Debra,
From the sound of it, you're fine just keeping the data on the remote server. The only time you might need to load the data into your local server is if you need to join tables on the linked server with tables on your local server. When you need to do that it creates a lot of network traffic and is not efficient.
As for the actual queries you need, it sounds like you just need a basic select statement like:
SELECT member_name
FROM members
WHERE memberid = 1234
however since it's on a linked server you need to use the fully qualified name which includes the lined server name:
SELECT member_name
FROM [linkedservername].[databasename].[dbo].members
WHERE memberid = 1234
That should perform the query. Just replace the names above with your linked server name, and it's database name and it should work.