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
 Transact-SQL (2000)
 Stored Procedure Problem

Author  Topic 

LearnEveryDay
Starting Member

37 Posts

Posted - 2005-09-02 : 11:19:22
Hello,

I have written the following sp to run in loop to insert few records. But it is not working properly. Can you let me know what I am missing her........

ALTER proc testytest
as

declare @i int
set @i=1
while (@i = 5)
begin
insert into mytable(orderid)values(@i)
set @i = @i +1
continue
end

VladRUS.ca
Starting Member

23 Posts

Posted - 2005-09-02 : 11:22:42
while (@i <= 5)
Go to Top of Page

LearnEveryDay
Starting Member

37 Posts

Posted - 2005-09-02 : 11:28:33
Thanks it works alright

cheers
Go to Top of Page
   

- Advertisement -