The FOR loop iterates over a defined variable by incrementing the value with the specified increment.
FOR @variable=start_value TO end_value+increment_value
PRINT ‘The value of @variable is now:’+@variable
NEXT
DECLARE @i as int
FOR @i=1 TO 10+1
PRINT 'Value of variable '' + @i
NEXT
Comments
Please sign in to leave a comment.