Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 14th, 2011, 04: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.
Reply With Quote
  #2 (permalink)  
Old January 26th, 2014, 09:27 AM
Registered User
Points: 35, Level: 1
Points: 35, Level: 1 Points: 35, Level: 1 Points: 35, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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 09:55 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 03:25 PM
Pls i need Ur help How 2 cnect VB6 DTBASE SQL SVR haron_Master VB How-To 9 March 19th, 2006 11:26 AM
http image retrieval from rem svr to local web svr Stuart Stalker Classic ASP Professional 0 December 30th, 2004 11:07 AM
desc table miguel.ossa SQL Server 2000 2 February 26th, 2004 10:47 AM



All times are GMT -4. The time now is 04:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.