Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Break Vs Return

Nov 12 2010 4:30AM by Madhivanan   

Suppose you have a set of codes and when a particular condition is true, you want to terminate or switch to another set of code, you can use Break commnad. I see sometimes people use return commnad for this. But there is a significant difference between these two. Consider this example

Usage of BREAK (select will be executed)

declare @i int
set @i=1
while 1=1
begin
	print @i
	if @i>10 break
	set @i=@i+1
end
select @i

Usage of RETURN (select will not be executed)

declare @i int
set @i=1
while 1=1
begin
	print @i
	if @i>10 return
	set @i=@i+1
end
select @i

So what happens is when break command is used, it just terminate the current block (created by if clause, while loop etc), but return will terminate the entire block

Tags: t-sql, sql_server, tsql, BRH, SQL Server, #TSQL, #SQLServer, break, return,


Madhivanan
3 · 40% · 12958
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]