Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

while loop sql

/* while loop SQL Server */
DECLARE @Counter INT 
SET @Counter = 1
WHILE (@Counter <= 10)
BEGIN
    PRINT 'The counter value is = ' + CONVERT(VARCHAR, @Counter)
    SET @Counter = @Counter  + 1
END
Source by www.sqlshack.com #
 
PREVIOUS NEXT
Tagged: #loop #sql
ADD COMMENT
Topic
Name
2+7 =