Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

A loop while that doesn't work...where I'm wrong?

$
0
0

Hi guys, I have this simple code:

declare @icur as int
declare @imax as int
set @icur=1
set @imax=@@rowcount
WHILE (@icur <= @imax)
BEGIN
UPDATE helpino SET incre=@icur
set @icur=@icur+1
end

but it doesn't work...it doesn't update incre. It remains 1 ( and not 1,2,3, etc)

Where I'm wrong?


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>