all groups > sql server dts > december 2004 >
You're in the

sql server dts

group:

primary key exception logging


primary key exception logging Andrew
12/6/2004 6:43:02 AM
sql server dts:
I am inserting data from a text file into an SQLserver table.

the text file could have rows which cause a primary key exceptions.

I want to be able to log the row in the file that a primary key exception is
raised.

I need to use "Fast Load" so I cannot use the Data Pump Phase - Insert
Failure.

I have thought about using a staging DB, it is a possibility, but was
wondering if anyone had any ideas on somehow logging the row number that the
exception occurs at.

thanks

Andrew

Re: primary key exception logging Allan Mitchell
12/6/2004 6:42:16 PM
The problem with a primary key violation is that it will abort the batch
there and then.
I personally would stage the data anyway using a text file and you can
easily then compare in TSQL

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


[quoted text, click to view]

AddThis Social Bookmark Button