Hi,Hi,I have a temp table with a columns such as bu_id,salesrep_id,billto_idI have 3 other lookup tables:businessunit table with bu_id,bufile_idsalesrep table with salesrep_id, salesrep_fileidbillto table with billto_id and billtofile_idThe values that are inputted into the temp table are the fileidsI need to run through the table and check if the values in the temp table exist in the lookup tables and if not raise an error.Is it possible to have one select statement for the 3 fields as there is no direct relationship between them?This is what i have nowset @XMLResult=(SELECT ColorCommaDelimitedList = Stuff((SELECT DISTINCT ', ' + businessunit_id AS [text()] FROM (select businessunit_id from TEMP_DDPL2 where businessunit_id not in (select businessunit_fileID from BusinessUnit)) x For XML Path ('')),1,1,'') )if len(@XMLResult)>0 beginRAISERROR('Business unit not found: %s ',16,1,@XMLResult) RETURNendThanksWhisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.