views:

1506

answers:

4
+3  Q: 

Debugging in SSIS

How do I debug .NET code written within a script task in a SSIS package? The development environment allows placing a breakpoint however does not take me to the code like it would in regular .NET programming while debugging.

Also, I am at a loss to understand how to add the SSIS package variables to the debug watch window?

Currently one thing I figured was the use of msgbox. But thats no substitute to a full fledged debugging using the development environment. Any help is appreciated. Thanks.

A: 

Debugging SSIS packages within the BIDS environment is not the same ball game as working with Visual Studio.

You may find it useful to consult the reference Debugging How-To-Topics(SSIS)

If you have developed your very own custom component, i.e. from within visual studio, then you should be able to debug the specific functionality of that component within the Visual Studio environment, prior to making the component available for use within BIDS.

You are not able to debug the internal .NET code that makes up any of the other built in SSIS components (i.e. the FTP Task) within BIDS so I doubt a custom component will be any different.

John Sansom
+1  A: 

I think SSIS does support and stop on breakpoint in Script Task (in the Control Flow). It does not support it for Script Transform (in the Data Flow). It is very unfortunate restrictions indeed.

SSIS shows variable values in watch window when you stop on a breakpoint. I'm not sure about script breakpoint, but the SSIS breakpoints (on-pre-execute, etc) it work. But you need a breakpoint - you can't watch variable value at random moment without breakpoint.

Michael
+1  A: 

Note: If you are running on x64 you must change the project (SSIS) Debug propertie Run64BitRuntime to false.

After that you'll be able to debug a script task in .net, and break code in the script.

By the way John Sansom dont appear to have read this part of the question: How do I debug .NET code written within a script task in a SSIS package? Its a script task, not normal SSIS debugging.

Hope this helps.

Gabriel Guimarães
A: 

You can attach a debugger to (almost) any process for which you're writing .NET code by embedding a call to Debugger.Break at the appropriate point in your source.

Quoting MSDN:

If no debugger is attached, users are asked if they want to attach a debugger. If yes, the debugger is started. If a debugger is attached, the debugger is signaled with a user breakpoint event, and the debugger suspends execution of the process just as if a debugger breakpoint had been hit.

I've used this to debug all sorts of things - should work in SSIS as well.

Bevan