Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SQLIsTheDevil
Posting Yak Master
177 Posts |
Posted - 2007-10-19 : 13:09:59
|
In my stored procedure, I have a while loop. It craps out of the while loop with no error messages. The while loops is iterating through a table derived from a query. So...I loaded the debugger and investigated the cause. I also declared a variable named counter as part of the while condition, so that I can control when it exits. Normally, it should exit when fetch_status no longer is 0. Here's what the while expression now looks like:while @@Fetch_Status = 0 and @counter <= 48066BEGIN ...ENDI found out the while loop is crapping out at counter = 48066. So, what I'd like to do is set counter to 48065 in the debugger, with the appropriate values from the query. The problem is I have no clue how to manually specify values in the debugger or anything of the sort. How do I go about accomplishing this?Thank you. |
|
SQLIsTheDevil
Posting Yak Master
177 Posts |
Posted - 2007-10-19 : 13:39:04
|
Actually, I figured out how to change the values...but, I'm using a cursor to retrieve data from a table, row-by-row. That is, in the while loop, it's fetching one row at a time, and there are about 64000 rows I need to retrive and manipulate. So, what I want to do is, somehow, using the debugger, execute the while loop 48065 times automatically without having to press F11 a million times, sort of like a breakpoint that stops at the 48065th time the while loop is executed. How does one go about this? |
 |
|
|
|
|
|
|