Thread: DTSLookup error handling
04-18-06, 16:04 #1Registered User
- Join Date
- Apr 2006
Unanswered: DTSLookup error handling
Does any one know how I can capture the sql error message when the sql statement in DTSLookup step fails?
I have this sql statement in a DTSLookup task:
insert into table1 (col1) values (?); select @@ERROR
Let's say for some reason (bad data), my insert statement fails and I want to know why. So I added "select @@ERROR" to capture the error. However, from the Lookup window, I cannot save the result of @@ERROR to a global variable or to an output parameter. I want to log this error in the next step that handles the OnFailure workflow, but I don't know how.
Can someone help please?
04-18-06, 16:51 #2Registered User
Originally Posted by DTS learner
- Join Date
- Dec 2002
From what I recall, you cannot handle DTS errors in VB Script, which is maddening to me. We sorta got around this by creating a VB DLL and then instantiated the VB DLL from within a calling DTS package. I've never been really happy with the solution, but I'm just the production DBA and not the "real" DBA .
hmscottHave you hugged your backup today?