while loop sql

Solutions on MaxInterview for while loop sql by the best coders in the world

showing results for - "while loop sql"
Alden
26 Oct 2016
1/* while loop SQL Server */
2DECLARE @Counter INT 
3SET @Counter = 1
4WHILE (@Counter <= 10)
5BEGIN
6    PRINT 'The counter value is = ' + CONVERT(VARCHAR, @Counter)
7    SET @Counter = @Counter  + 1
8END