Solved

DTS Error Logging

Posted on 2011-03-23
4
292 Views
Last Modified: 2012-05-11
Recently we received an error using one of our scheduled DTS packages. The problem was due to bad data, however the error logging is extremely generic and it took me quite a while to find the specific row that contained the bad data.  I reran the step and was able to determine that the problem occurred after the 39000th record and before the 40000th record, but that's the best I could get.   I removed that record, and everything ran fine.
My question is, is there a way to make the error logging more specific?
Do you know of any way to identify the record causing failure in a better way?  If that's not possible, is there a way we can set the record number display to be less than 1000?  Something like 100 might make it easier to narrow down an offending record.  50 or 25 would be even better.

Thanks in advance.
0
Comment
Question by:Goosie1
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 35202353
I assume you are talking about SQL 2000 DTS packages and you should enable logging as described at the link below:

http://msdn.microsoft.com/en-us/library/aa216427(v=sql.80).aspx

However...if you know that a (I assume) data transfer task could fail because of bad data then I suggest you include a data validation task before that and fail the package at that point sending an alert as well - or even better - do that first in your package why waste time and maybe rollback needed to wait for that task.
0
 

Author Comment

by:Goosie1
ID: 35206855
First let me say that I am a very new user to DTS. I am using SQL 2000 DTS packages. I have the enable logging turned on. My problem is that the logging is not specific as to what data caused the error.  Your suggestion to include a data validation first is a good one. However I am unsure how to do this? Can you advise?
0
 
LVL 39

Expert Comment

by:lcohan
ID: 35207148
You do have a query that you can run against the source table(s) to find bad data right? I mean you deleted bad records from the source table then your SSIS import worked well so you should take that same query and put it in a IF EXISTS statement and if indeed there's bad data or in other words the IF EXISTS evaluates true then you could generate for instance an error right there so the package will fail. I did this (cheap I know) but it works perfectly in 2000 where I create a temp table with PK and force duplicate values that will generate an error. Well obviously this being tied to the IF EXISTS step I can use RAISEERROR and change the message from pk violation to whatever you want and this will be logged as well - something like in the code below:

declare @msg varchar(400)
create table #test (col1 int primary key)
--test if bad data exists
if exists (select * from source_data where bla = bla)
begin
      insert into #test values (1)
      insert into #test values (1)
      
      set @msg ='Operation Failed!!!'+char(13)+'Please check Data Source table'
      if @msg is not null
      RAISERROR (@msg, 16, 1) with log
end
drop table #test
go


0
 

Author Comment

by:Goosie1
ID: 35333587
I found the logging in the data pump task is exactly what I was looking for. It prints out the data that causes the step to fail. Thanks very much for leading me to this!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question