I am using ...SqlBulkCopy... to bulk insert records into a database....Below is the code for it. What bothers me is that when I use ...SqlBulkCopy... I get FOREIGN KEY constraint error and for exact same records if I use ...UNION ALL... approach it works ...