2

I have a ForEach Loop Container that is supposed to iterate through the records in an Ado Enumerator. The Enumberation mode = Rows in the first table.

I built a Script Task to write a MessageBox for each iteration. It only shows the message for the 1st iteration. After that it hangs.

I tried building the solution and running the package and it works fine. But in the development/design realm it still hangs.

Is that how it's supposed to work in the design mode? How can I test things downstream of the Foreach container if it's going to hang when I debug it?

Smandoli
  • 6,919
  • 3
  • 49
  • 83
  • are you able to add a debug point in your code to step thru and see if you are getting the loop but it is just not hitting the message box? Honestly the message box is really not something you typically see in ssis due to the nature of its expected deployment. You can you it but its really not the best way to go about debugging ssis – SFrejofsky May 24 '16 at 00:48

3 Answers3

3

When SSIS is running in Visual Studio/BIDS/SSDT and it just seems to hang, especially if there's a script task, look at the task bar. 11/10 a dialog has popped up indicating you have an error in your code.

As you are popping message boxes, the first one will get focus as it opens but the subsequent ones do not automatically gain focus.

My personal preference is to FireInformation events over message boxes as they work whether the process is running in attended versus unattended mode. Example over here

Community
  • 1
  • 1
billinkc
  • 59,250
  • 9
  • 102
  • 159
  • "As you are popping message boxes..." meaning it is not the case that an error has been flagged, but the point of difficulty is the same - your message box is under another window. – Smandoli Jun 28 '17 at 16:53
0

No, the ForEachLoop works the same way in Design Mode as it does when deployed to a server. If you are seeing it only iterate once, then the most likely explanation is that there is only one item to iterate over, and your data isn't what you think it is.

As suggested in a comment, you can put a break point on some point before and/or during your loop, and use Watches to peek into your variables to see what their values are. This should allow you to see why your ADO object only contains a single item.

Tab Alleman
  • 31,483
  • 7
  • 36
  • 52
0

I also encounter this and i made it work.

  1. be sure put your variable in the ReadOnlyVariable field - the field you want to show in the message box inside the script task.
  2. Remark or remove this statement in the script task: Dts.TaskResult = (int)ScriptResults.Success; i think it affects the process because its giving a success result.

hope it helps.

grail
  • 1
  • 1