Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Joins on linked DBs

$
0
0
Sorry it should have read "Select" not JoinI am trying to find out what records on in one DB and not the other. This SQL statement works find if the DBs are on the same Server. If I replace on the DBs with a linked DB (on another server) I get the following error.SELECT *FROM [LinkedServer].[DBonLinkedServer].[dbo].[Sales Price]WHERE NOT EXISTS (SELECT [LocalDB].[dbo].[Sales Price].* FROM [LocalDB].[dbo].[Sales Price] WHERE ([LocalDB].[dbo].[Sales Price].[Item No_] collate Latin1_General_CS_AS = [LinkedServer].[DBonLinkedServer].[dbo].[Sales Price].[Item No_]) AND ([LocalDB].[dbo].[Sales Price].[Unit of Measure Code] collate Latin1_General_CS_AS = [LinkedServer].[DBonLinkedServer].[dbo].[Sales Price].[Unit of Measure Code]) )Msg 4104, Level 16, State 1, Line 3The multi-part identifier "LinkedServer.DBonLinkedServer.dbo.Sales Price.Item No_" could not be bound.Msg 4104, Level 16, State 1, Line 4The multi-part identifier "LinkedServer.DBonLinkedServer.dbo.Sales Price.Unit of Measure Code" could not be bound.

Viewing all articles
Browse latest Browse all 3145

Trending Articles