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)
 DTS and Check Constraints

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-03-18 : 06:09:04
tuan writes "Hi,

When using DTS, is it possible trap errors caused by check-constraints?

For example, I have a check constraint in the first column and another in the second column. If my data does not comply to the rules set in the first column, is there a way for me to check whether my data satisfy the second columns condition?

Reason being that I would like to validate all my columns and log all the errors of each field ( if any ). But using check-constraints, DTS would only test until the column that has error, and then throws and exception without checking the rest.

If it is not possible, some expert advice on this issue would be greatly appreciated.

Also, is there a way for me to know which column and row DTS is processing?

Thanks!

regards,
Tuan"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-03-18 : 07:24:25
You can do it, but this is not the place to do it.

DTS (activex) is a procedural tool and will process your rows iteratively. This is (probably) slower and hard to code.

Import your data into a staging table without the constraints. Then, using set based operations, cleanse your data in a stored procedure and insert/update/delete your production tables.

Jay White
{0}
Go to Top of Page
   

- Advertisement -