Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Breakpoint not firing

Posted on 2010-11-16
14
Medium Priority
?
794 Views
Last Modified: 2013-11-10
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

0
Comment
Question by:hydev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
14 Comments
 
LVL 22

Expert Comment

by:8080_Diver
ID: 34147327
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?
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 34147879
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?
0
 

Author Comment

by:hydev
ID: 34153307
Okay here are some screen shots:

container.jpg
code.jpg
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 22

Expert Comment

by:8080_Diver
ID: 34155515
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).

0
 

Author Comment

by:hydev
ID: 34155946
Same result I'm afraid.
0
 
LVL 22

Expert Comment

by:8080_Diver
ID: 34156203
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?
0
 

Author Comment

by:hydev
ID: 34156697
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
0
 
LVL 22

Expert Comment

by:8080_Diver
ID: 34156835
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.
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 34157425
how many times your foreach loop will iterates? maybe this only iterate 1 time!
0
 

Author Comment

by:hydev
ID: 34163310
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.




0
 

Author Comment

by:hydev
ID: 34211242
I have been reminded that this question is abandoned - it's not, just that there is no solution and things have moved on.
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 34220722
upload your package here, and we can help you better
0
 
LVL 22

Accepted Solution

by:
8080_Diver earned 2000 total points
ID: 34232434
hydev,

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


Try it one more time (after removing the breakpoints that currently exist), only this time put a break point on each of the two lines (i.e. both of the lines after splitting the one you had a break point on before); however, don't edit the break points . . . just leave the default settings.  Then put a break point on the next line after those two, again leaving the default settings.

Now, when you execute the package and it stops the first time, set Watches for the various variables and look at them to see what values they have.  Then click the little green triangle to run to the next break point.  Now, look at the watched variables again to see if a) they have changed and b) whether their value might cause the script task to not be executed again.  Repeat the Run  and analyze steps, carefully noting the values of the variables and what actions are occurring.
0
 

Author Comment

by:hydev
ID: 34233030
Thanks I will try that :-)
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question