vrijdag 17 augustus 2012

Debugging an SSIS ‘Script Task’ and an SSIS ‘Script Component’.

Script Task : In many cases debugging a Script Task is not that difficult. Only if you have installed 64bit version of integration services you cannot debug. If you place a break point in a Script task, the debugger will not interrupt execution. Instead you will get error “Cannot debug script tasks when running under the 64 bit version of the Integration Services runtime.”. To make sure de debugger stops on breakpoints. Go to the project in your solution explorer, right mouse click and go to properties, then go  to ‘debugging’ and select Run64BitRuntime and change it to false.
Next time you run the package you will be able to debug. Once everything work you might want to switch back  to the 64bit runtime again.

Script Components : ‘Script Components’ are a bit different from ‘Script Tasks’. ‘Script Tasks’ can be used in the control flow and ‘Script Components’ can be only be used inside a Data Flow Tasks. They either act as a source, a destination or do a transformation. In many cases they are hard to debug. Because placing a break point will not stop the execution of the package ones it reaches the break point. Some of my college say they put messageboxes in the code to see what happens. I doesn’t work for me. I prefer putting  Debug.Write lines in it.
like this :
System.Diagnostics.Trace.Write("Klant " + Dts.Variables["FolderKLANT"].Value);
To see this feedback or debug info you must download a small utility called debug view
Once you run this itwill capture all the Debug.Writes you have placed in you scripts

Make sure you run the 32bit Run time. See above.
If you let the Debug.Write statements in your script if won’t be a big problem. With any luck if you have the right tou will be able to debug the production versions of your package. You can let DebugView utility connect to another computer or server
I hope this makes you life a bit  easier, and lets you produce more stable packages.

Geen opmerkingen:

Een reactie posten