Solved

Using Break in a nexted Query

Posted on 2014-02-18
4
149 Views
Last Modified: 2014-02-23
Hi all
I have a while loop in a nexted query

1: Query do some proccessing.. Control checks
2: If the check is okay.. Get values..
3: Insert values until I have reach the maximum (Since I have break here.. My code stops)
4: clean up isolated transaction and write a report.

How can I continue to step 4, given that I am using the while loop  on step 3.

Thanks in Advance..

Sorry I am not a native speaker  :-)
0
Comment
Question by:ZURINET
  • 2
  • 2
4 Comments
 
LVL 35

Expert Comment

by:David Todd
ID: 39869560
Hi,

Are steps 1 - 4 in the loop, or just step 3?

Any chance of posting the code - its just that there are a number of different ways to test for the end of loop or continue in loop conditions, and without seeing your code I'm more likely to be wrong than right.

Regards
  David
0
 

Accepted Solution

by:
ZURINET earned 0 total points
ID: 39869619
sorry 
just solved it

 WHILE (@Flag < @counterCheck)
	 BEGIN								 
	
	-- SQL STATEMENT				
	SET @Flag		= @Flag	+ 1
	SET @PositionNr	= @PositionNr + 1								
	END		

Open in new window

0
 
LVL 35

Expert Comment

by:David Todd
ID: 39869673
Hi,

That's cool that you've solved it!

Regards
  David
0
 

Author Closing Comment

by:ZURINET
ID: 39880411
Just solved it
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now