How to force a message from a script task into the Job History?
I typically use "MsgBox" functions while developing an SSIS package (in 2008 R2) to tell me things like whether or not a file was actually found before attempting to restore it. The package executes successfully from BIDS, where the message boxes pop up as expected. Of course, when I create a SQL Agent Job to execute this package, it fails on the MsgBox statement with the error "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation." How can I force a message I generate from a Script Task to show up in the Package History text? Thanks, Eric
February 8th, 2011 1:57pm

Isn't firing an event an option? http://msdn.microsoft.com/en-us/library/ms136054.aspx See example in the Forum. Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
February 8th, 2011 2:01pm

Best to disable all MsgBox code lines in your script tasks before deploying. They are designed to have a pair of eyes watching for them, and since SQL Agent runs unattended, they fail. Based on SSISJoost: try this: Dts.Events.FireInformation(1, "", "Some message here", 0, False)Todd C - MSCTS SQL Server 2005 - Please mark posts as answered where appropriate.
February 8th, 2011 2:16pm

I concur with Joost and Todd C - use FireInformation, FireWarning, or FireError. The problem is, none of those will show in the Agent Job Step History, if that's what you're talking about. They will all show up in the Output window in BIDS when you're running the package interactively, and they can also be configured to appear in the SSIS Package Log at runtime. (Use Package Logging!) Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
February 8th, 2011 2:32pm

Thanks, SSISJoost and both Todds. It took me awhile to figure out how it all works, but I've finally got Package Logging employed and I can now see my Information messages. I'm well on my way to resolving all those "secret" errors. For anybody else who finds this page while looking for help getting Package Logging set up, here's a very handy YouTube video: http://www.youtube.com/watch?v=1Ei5Gh5NJMM
February 9th, 2011 11:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics