question

Ben_G avatar image
Ben_G asked

Linked server cannot see all of the rows in target server?

I was having trouble establishing a linked server, but thanks to some help I got on this forum the link is now working. The problem now is that I can't see all of the rows in the linked-server's tables. So if I run select count(*) from cmrez.dbo.reservations on the target server itself it returns 809472, but if I run the same query from a remote server I only get 78324. What's up with that!? EDIT - The linked server isn't working - it turns out that the source server also has a database/table called CMREZ.dbo.reservations, so that is what is being queried. So the linked server isn't linking correctly. It no longer gives me an error message when I try to query it, but it is fact not working. Any ideas why?
sql serverlink-server
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dave_Green avatar image Dave_Green ♦ commented ·
How are you querying the linked server? 4 part name in the query (Server.database.schema.table)?
1 Like 1 ·
Ben_G avatar image Ben_G commented ·
Yes - 4-part name.
0 Likes 0 ·
JohnM avatar image JohnM commented ·
Does it give you any messages as at all?
0 Likes 0 ·
Ben_G avatar image Ben_G commented ·
Yes - I get "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.". I've found that I can get around this using a dedicated login that I specify with the linked server setup (which is not ideal - I'd rather use the default login using passthrough authentication).
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.