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 2000 Forums
 SQL Server Development (2000)
 Playing around with a while statement

Author  Topic 

John T.
Posting Yak Master

112 Posts

Posted - 2003-04-25 : 20:13:52
I am just playing around with a while statement. Staying simple and trying to get the hang of loops in SQL.
CREATE PROCEDURE loadstart @gno SMALLINT AS
DECLARE @ind SMALLINT
SET @ind = 0
WHILE @ind < gno
INSERT INTO Tablex(num)
VALUES(@ind)
SET @ind = @ind + 1
END WHILE
Simply trying to load a table using some kind of loop. Want to see it work. Thanks.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-04-25 : 20:33:51
Take a look here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=25685

There are a ton of ways to do it without using loops.

Go to Top of Page
   

- Advertisement -