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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 while loop?

Author  Topic 

krish001
Yak Posting Veteran

61 Posts

Posted - 2010-01-01 : 13:14:24
how to write a loop??

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-01-01 : 13:36:39
[code]declare @i int
set @i = 0
WHILE @i <10
BEGIN
select @i = @i + 1
print @i
END[/code]


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-02 : 01:54:56
have you thought of set based alternatives? or is attempt to learn WHILE syntax?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-01-04 : 02:02:33
quote:
Originally posted by krish001

how to write a loop??


What are you trying to do using a loop?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -