Link to home
Create AccountLog in
Avatar of hydev
hydevFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Breakpoint not firing

Hi,

I am having great difficulty with the following debugging issue.

I have a For Each Loop container that has a script task within it.
 
In the script task I have set a break point.

Every time I run the package the break point is triggered ONCE then when I hit Continue to carry on the break point is not hit again, it just goes through the For Each and Script task completely ignoring it.

The Breakpoint in the Script task will always be hit and is not conditional.  This is most frustrating as I can't debug my code.

Thanks

Mike

Avatar of 8080_Diver
8080_Diver
Flag of United States of America image

What is the text of the script task?  E.g. is the break point, perhaps, on a statement that is in one half of an IF statement and the rest of the data is not hitting that condition?
Avatar of Reza Rad
maybe your foreach loops only one time. or maybe you put break point in the position that not happen all times ( as 8080_Diver noted )
could  you tell us more details about your package or put screenshots of your schema and script here?
Avatar of hydev

ASKER

Okay here are some screen shots:

container.jpg
code.jpg
Try splitting the line with the break point into two lines: one declaring the variable and the next setting the value.  Then put the break point on the second line (i.e. the one setting the value).

Avatar of hydev

ASKER

Same result I'm afraid.
Okay, put a break point on the Script Task itself.  Then set a watch for whatever is controlling the For Each Loop and see what is going on with that variable.

Also, what are the various "var_R_" variables used for in the reas of the script task's script?  Can you put a breakpoint on one of those lines and have it fire every time the task is executed?
Avatar of hydev

ASKER

I'm relatively new to SSIS (but not to programming) what do you mean put a watch on the Script Task itself?

The various "var_R" are just some variables I am passing for processing from the For Each loop.  I have tried moving the watch points around and it does the same.

mike
what do you mean put a watch on the Script Task itself?

Actually what I wrote was:
Okay, put a break point on the Script Task itself.  Then set a watch for whatever is controlling the For Each Loop and see what is going on with that variable.

If the "var_R" variables are not used anywhere except within the Script Task and are simply set within that task, then that is probably why the break point is not being hit.  Those "sets" are the equivalent of NO-OP statements if that is all that is in the Script Task.  

Try putting that break point in and adding the watch.
how many times your foreach loop will iterates? maybe this only iterate 1 time!
Avatar of hydev

ASKER

I apologise 8080_Diver if I misread what you had put.  Your explanation helps but I think I am missing something very fundamental.  

The var_R variables are used within the script as it's easier to reference a simple variable name instead of DTS.Variables["variable_name"].Value  Hence that's why I have put it - it just makes my code easier to read.

So, I edit the script and put a watch a break condition on a line.  
Then, I right click the Script task and select "Edit Break Points" this give me a list of many different options.  One of them is already marked with a tick.  Which of these ones should I tick?

Out of interest I ticked the first one "Break when the container receives the OnPreExecute event".  When I run the script it stops but, F8, F10, F11 nothing moves on SSIS just hangs.




Avatar of hydev

ASKER

I have been reminded that this question is abandoned - it's not, just that there is no solution and things have moved on.
upload your package here, and we can help you better
ASKER CERTIFIED SOLUTION
Avatar of 8080_Diver
8080_Diver
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of hydev

ASKER

Thanks I will try that :-)