The following query runs on the SQL server box that has the 'sourcetable'. Its function is to add new records to the 'targettable' on the remote linked server. It correctly adds rows when I have the 'targettable' set with column 'phoneleadid' as the primary key. It runs but, does not add rows if I set another column as primary key and allow nulls in 'phoneleadid'. Any way to get this to run without having 'phoneleadid' be the primary key for 'targettable'? (There is no primary key on 'sourcetable'.)
Oakgrove Computer Grouper
Lansing, MI
Code:
insert into [67.xx.xxx.xxx].[server1].[dbo].[targettable]
(phoneleadid,pnumber)
select callid,localuserid
from [sourcetable]
where callid not in(select phoneleadid
from [67.xx.xxx.xxx].[server1].[dbo].[targettable])
Oakgrove Computer Grouper
Lansing, MI