Wrox Programmer Forums
|
BOOK: Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services
This is the forum to discuss the Wrox book Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services by Brian Knight, Devin Knight, Mike Davis ISBN: 978-0-470-49692-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 14th, 2011, 05:30 PM
Registered User
 
Join Date: Feb 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do you get the SQL Svr error code/desc?

When SSIS packages work, they are great. But when rows cannot be inserted into the destination, I'd like to get the SQL Server error code and desc to include in a text file where I can also re-direct the row.

Currently, I only have the ErrorCode that SSIS inserts for you. But seeing:
-1071610801 - An error has occurred while sending this row to
destination data source.

When I enable logging, I can create a text file that contains a log of debug output and lines like this when I force a duplicate:
Violation of PRIMARY KEY constraint 'PK_BidCommodities'.
Cannot insert duplicate key in object 'dbo.BidCommodities'.
I get this line for each row of data that failed...however logging will not show the data row so is not helpful to fix the data.
 
Old January 26th, 2014, 10:27 AM
Registered User
 
Join Date: Jan 2014
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Even in an SSMS console SQL Server doesn't tell you which value is violating the PK.

This is a basic SQL skill that should be learned before diving into SSIS.

The easiest way to find the duplicate is to join the dataset you're inserting from with the table you're inserting to on the PK column.

Last edited by apratsunrthd; January 31st, 2014 at 10:55 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use IN statement with asc/desc in ORACLE/SQL queries? arbab SQL Language 1 September 20th, 2010 08:46 AM
How to deal with SQL connection error in ASP code kwilliams Classic ASP Professional 8 February 16th, 2010 04:25 PM
Pls i need Ur help How 2 cnect VB6 DTBASE SQL SVR haron_Master VB How-To 9 March 19th, 2006 12:26 PM
http image retrieval from rem svr to local web svr Stuart Stalker Classic ASP Professional 0 December 30th, 2004 12:07 PM
desc table miguel.ossa SQL Server 2000 2 February 26th, 2004 11:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.