Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Bulk Insert error logging Expand / Collapse
Author
Message
Posted Wednesday, April 16, 2008 5:28 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, November 17, 2010 5:56 PM
Points: 185, Visits: 637
I simply want to log any errors that occur in a Bulk Insert task.

I'm simply going from a flat file to a table and it's all working fine, except for the error logging.

I have logging set up and it's partially working - only a single error is reported.

Say I have five rows in the input file and rows 3 and 5 have "bad" data (incorrect types, too long, whatever). When the Bulk Insert task runs, the "bad" records don't get inserted which is correct.

The problem is that only the first errored line (row 3) gets reported and logged. How can I get ALL errors and warning to get logged?

Cheers
Post #485557
Posted Wednesday, April 16, 2008 9:50 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, August 13, 2013 9:44 AM
Points: 627, Visits: 509
One option I can think of is redirect error to flat file. Just use dataviewers to see how the bad rows gets directed.
Thanks.,
Post #485785
Posted Wednesday, April 16, 2008 9:26 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, November 17, 2010 5:56 PM
Points: 185, Visits: 637
I already have logging set up to redirect the errors to a flat file.
problem is only the first error is getting thrown.
Post #486082
Posted Wednesday, April 16, 2008 10:57 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, November 17, 2010 5:56 PM
Points: 185, Visits: 637
It turns out that I'm blind and the single error event that gets raised sends all of the errors in the ErrorDescription variable. So I just need to parse the line and extract the separate messages out of it. Not very neat but I guess it will have to do.

Sorry for the mistake.
Post #486107
Posted Thursday, April 17, 2008 2:39 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, November 17, 2010 5:56 PM
Points: 185, Visits: 637
I just realised that I had set the batchsize to something greater than the number of rows in the input file, hence why multiple errors were being put into the error description.

If i set the batch size to 1, then only the first error gets reported.

I'm thinking there must be another setting somewhere in there which will get me what I want - a separate error for each bad row in the file.
Post #486207
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse