Hi Matt,
Can you try:
INSERT INTO {ZipCodes_ServiceMapping}
([ZipCodeId],
[ServiceTypeID],
[IsSubContracted])
SELECT t1.[ZipCodeId],
@CopyToID,
t1.[IsSubContracted]
FROM {ZipCodes_ServiceMapping} t1
WHERE t1.[ServiceTypeID] = @CopyFromID and
NOT EXISTS (SELECT 1
FROM {ZipCodes_ServiceMapping} t2
WHERE t2.[ServiceTypeID] = @CopyToID and
t1.[ZipCodeId] = t2.[ZipCodeId])
First, you don't need the table before the field in the fields inside the INSERT INTO and for the NOT EXISTS, you just need to have SELECT 1, you don't need to specify more than that.
Kind Regards,
João