0

I am using MS SQL Server 2000 and have a link from a test db to a live db which is in replication. The link seems to work fine and I can select from any of the tables using any of the fields apart from the field with the constraints on creating ids. So if I run select * from person where firstname like 'john' this works fine, but then if I run select * from person where id =1 then I get no data returned and I get no errors but the record exists.

Any advise is much appreciated.

Thanks

Andy Lester
  • 91,102
  • 13
  • 100
  • 152
user107779
  • 41
  • 1
  • 2
  • 8
  • Can you give the exact SQL? Your LIKE example looks flawed as it's not using any wildcards and some would be no different to using = – MartW Nov 24 '09 at 17:55
  • Ignore the 'some' - T9 strikes again - should be 'so' – MartW Nov 24 '09 at 17:56

3 Answers3

0

If select * from person where id =1 returns no rows then the record doesn't exist.

Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
0

It's been a few years since I've worked with linked servers, but have you tried running profiler against the linked server (the live DB) to see that it's receiving the select statement and that it's receiving it correctly?

Tom H
  • 46,766
  • 14
  • 87
  • 128
0

Can you see the record in enterprise manager through the dblink, or are you looking at the linked db directly?

Maybe your link is not pointing where you think it is.

Scott Bruns
  • 1,971
  • 12
  • 12