I have not. I will check to see what that does and report back.
Thanks!
Main Topics
Browse All TopicsI am helping with a large DTS package in SQL Server 2000. It does many updates and inserts. If we treat it as one big transaction using “[x] Join transaction if present” in the workflow properties of the tasks, the package undoes its updates and inserts when a step fails.
Perfect! Transactions! Love ‘em!
But, we need to allow the package to log its progress to a SQL table as it goes through its many, many steps.
Question: How to allow it to actually write to our diagnostic table, while rolling back all the work it did on the real user tables up to the step that failed?
We don’t have access to the application error log on the server.
We are using the DTS Designer in the Enterprise Manager.
The package is pretty much done except for this minor detail.
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Logging, along with exception logging, and not using [x] 7.0 compatibility looks like it could provide enough information for us to figure out what went wrong when a step fails. Our custom log table records the step name, time and @@ROWCOUNT. I'm not sure if the built-in logger will match the @@ROWCOUNT information, which could come in handy finding the bad row.
The biggest snag, however, is that logging is only available on data transformation and data driven query tasks, and most of our tasks are execute sql tasks. I think we'd have to redo all those to be data driven queries so that we'd have logging available, which is a ton of work.
Are you sure there isn't a way to isolate the "insert into the custom status table" tasks from the rest--trasactionally speaking? They are separate tasks in the DTS package (on failure workflow).
?
But when you process the staging table, how do you know where it fails validation? The DTS package with all the tasks and connections is a very cool way to bring outside data into SQL. However, when something goes wrong, it's nice to have the "undo" provided by the transaction rollback. Tell me this, if your DTS package writes to the System Application Log, a custom log for your app that is, do those log writes get rolled back with the writes to the SQL database? If they persist after the rest is rolled back, I could use that, maybe. Do you know?
Thanks!
>>But when you process the staging table, how do you know where it fails validation?<<
Once the data is imported into the staging table you can then implement all the appropriate validation. For example, check to see if the dates are valid dates (assuming they were imported into a varchar column), as in:
If EXISTS (Select 1 From StagingTable Where ISDATE(YourDateColumn) = 0
Begin
-- Here you add all your Error Handling code for this event.
End
>>Tell me this, if your DTS package writes to the System Application Log, a custom log for your app that is, do those log writes get rolled back with the writes to the SQL database?<<
Not sure what you are talking about here:
If it is the Log Package execution I mentioned previously, the answer is no. It is not rolled back.
If it is the Error file in the same Logging tab, than you should know this is a text file, so there is no "rollback".
>> Not sure what you are talking about here:<<
I am talking about these types of writes to the system event log (below). Do they get rolled back, probably not. Good to know the writes to the TXT log files don't get rolled back either. There is a lot of information there. I also found that I can read and write the system application log even though I'm not allowed on that server! Which is cool because the administrator is not very nice about letting people on "his" servers.
EventLog1.WriteEntry("This
EventLog1.WriteEntry("This
Diagnostics.EventLogEntryT
Business Accounts
Answer for Membership
by: acperkinsPosted on 2006-03-01 at 15:48:38ID: 16080635
Have you considered selecting the "Log package execution to SQL Server" in the Logging tab?