I have the following T-SQL code (in SQL 2000) which functions correctly:
INSERT INTO M2MDATA01.dbo.cspopup (fcpopkey,
fcpoptext,
fcpopval,
fnorder,
fcpopacces)
SELECT CSP69.fcpopkey,
CSP69.fcpoptext,
CSP69.fcpopval,
CSP69.fnorder,
CSP69.fcpopacces
FROM M2MData69..CSPOPUP CSP69
WHERE CSP69.fcpopkey = 'SHIPVIA'
AND NOT EXISTS
(SELECT CS01.identity_column
FROM m2mdata01..cspopup CS01
WHERE CS01.identity_column = CSP69.identity_column)
There just has to be a more elegant way of doing it. I'm referencing the same table two different ways in the same script here.
Any suggestions?