Code to check row existence during Import | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Code to check row existence during Import

Hi All, I am trying to make an Access Project using SQL Server 2000 DTS functionalities. I have to import selective columns from a table of dbase5 database into SQL Server table. Every day, the dbase5 table will have some new rows. This table in dbase5 does not have any column which uniquely identifies the new rows. However, it does have 2 columns – one each for date and time, which could be used. For the first time, I want to import all rows (abt 50K rows) and subsequently, I want my program in DTS to check for only new rows and import them only, not the whole recordset. My idea was to concat the date & time columns, compare these 2 columns with the already imported data in SQL Server table and only import the latest rows, which are new & not yet imported. What method should I use and the code that will get this done? Any assistance or pointing to right links is highly appreciated. Thanks Vishal Sood
If you are doing a daily import you can use a select statement as your data source and add a date comparison. The Romans did not create a great empire by having meetings…they did it by killing all who opposed them.