In SQL Server 2012, you can now debug the Script component by setting breakpoints and running the package in SQL Server Data Tools (replaces BIDS) .
When the package execution enters the Script component, the VSTA IDE reopens and displays your code in read-only mode. After execution reaches your breakpoint, you can examine variable values and step through the remaining code.
On a side note, we upgraded the scripting engine to VSTA 3.0, which provides a Visual Studio 2010 shell and support for .NET 4.
Here are a few things to keep in mind when debugging the Script component.
- You can’t debug a Script component when you run the Script component as part of a child package that is run from an Execute Package task. Breakpoints that you set in the Script component in the child package are disregarded in these circumstances. You can debug the child package normally by running it separately.
- When you debug a package that contains multiple Script components, the debugger debugs one Script component. The system can debug another Script component if the debugger completes, as in the case of a Foreach Loop or For Loop container.
As with previous versions of SSIS, you can also monitor the execution of the Script component by using these methods:
- Interrupt execution and display a modal message by using the MessageBox.Show method in the System.Windows.Forms namespace.
- Raise events for informational messages, warnings, and errors. For more information, see the Developer’s Guide topic, Raising Events in the Script Component.
- Log events or user-defined messages to enabled logging providers. For more information, see the Books Online topic, Logging in the Script Component.