Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Duplicate keys - Urgent

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-11 : 10:15:19
Nivedita writes "Hi,
I am importing data from a flat file to SQL server database using VB Script ie. DTS engine
If there is a duplicate item in the import files(which is already present in the destination table) it gives an error and comes out (i.e the execution of the package stops)
I want it to work in such a way that it skips the row with the primary constraint violation and proceed with the next

How do i do this?
Thanks
Nivedita"

efelito
Constraint Violating Yak Guru

478 Posts

Posted - 2002-06-11 : 10:43:57
The screens will look a different depending on the version of SQL Server that you are using. If you are using a Script object you'll just have to code for the exceptions and and handle the errors. If you are using a transformation, go to the advanced tab and and set the max error count and an exception file. The process will then skip the problem records and record them in the exception file.

Jeff Banschbach
Consultant, MCDBA
Go to Top of Page
   

- Advertisement -