Steve, To check that the existing data does not violate an FK constraint you are about to add:
SELECT * FROM table2 WHERE fkid NOT IN (SELECT id FROM table1) On Mon, 6 Oct 2003 19:47:08 -0500, Fogelson, Steve wrote: >I am still moving data from foxpro. By the way thanks for all the help from >the list to accomplish this. I have 2 tables stuctured like the following: >Table1 >ID >Table2 >ID >FKID >Presently there is not a foreign key relationship. I want to test Table 2 >before I put it in place. I think I need to use a subselect. Never had to >use one. >I want to check and find all instances where Table2.FKID is not present in >Table1.ID

