How to debug a script component in SSIS

2020-03-01 03:56发布

It's simple but I can't make it work, and I read in so many places a lot of solutions but nothing worked for me. How can I accomplished this?

Note

I put a break point in my code and ran the entire package, but it still did not work.

5条回答
地球回转人心会变
2楼-- · 2020-03-01 04:10

The Script component does not support the use of breakpoints. Therefore, you cannot step through your code and examine values as the package runs. You can monitor the execution of the Script component by using the following methods

Interrupt execution and display a modal message by using the MessageBox.Show() method in the System.Windows.Forms namespace. (Remove this code after you complete the debugging process.)

Raise events for informational messages, warnings, and errors. The FireInformation, FireWarning, and FireError methods display the event description in the Visual Studio Output window. However, the FireProgress method, the Console.Write method, and Console.WriteLine method do not display any information in the Output window. Messages from the FireProgress event appear on the Progress tab of SSIS Designer.

http://microsoft-ssis.blogspot.com/2011/04/breakpoint-does-not-work-within-ssis.html

查看更多
劫难
3楼-- · 2020-03-01 04:16

For SSIS 2008 where you can only debug the Script Task not the Script Component as already noted by Joost, I've had success using

Trace.Writeline("SSIS .....");

Then I'm capturing this output with good ol Dbgview.exe from https://docs.microsoft.com/en-us/sysinternals/downloads/debugview. I set Edit->Filter->Include SSIS* and then if you're going to leave this on your desktop set the Debug View History Depth to 99999 or it'll fill up the log with no size limit!

查看更多
霸刀☆藐视天下
4楼-- · 2020-03-01 04:19

My issue was using the 64-bit runtime - I noticed in my output the following message "Cannot debug script tasks when running under the 64 bit version of the Integration Services runtime".

This is easily fixed by running the 32-bit runtime (e.g. temporarily) as explained here.

查看更多
对你真心纯属浪费
5楼-- · 2020-03-01 04:30

Breakpoints only work in a Script Task not in a Script Component

查看更多
Melony?
6楼-- · 2020-03-01 04:32

I know the MS Blog says that breakpoints do not function in Scripts, but MSDN seems to indicate that they do. Have you tried following the directions on MSDN?

查看更多
登录 后发表回答