Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DTS Error Logging

Posted on 2011-03-23
4
Medium Priority
?
302 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 40

Accepted Solution

by:
lcohan earned 2000 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 40

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

916 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