You are currently viewing the BOOK: Professional SQL Server 2000 Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
i have 2 tables.at the end of each day,data from table 1 gets deleted from it and get inserted into table2(using trigger)
how to ensure that no duplicate data gets inserted into table2?
Use a Primary Key Foriegn Key relation using some identity field in table1. Now while inserting use outer join to the table2 and insert only non matching ones, ie foriegn key in Table2 is null (OR a not in if only few recs)