Solved

DTS Error Logging

Posted on 2011-03-23
4
284 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Numeric sequence in SQL 14 38
Left Join with Tuple returning more rows 10 60
sql calculate averages 18 32
In or Between 2 0
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now