Search notes:

SQL Server T-SQL: while statement

The while statement allows to iterate over a statement (or a block of statements that is enclosed between begin … end) until a certain condition becomes false:
declare
   @i integer = 0;

while @i < 10 begin
   print('i = ' + ltrim(str(@i)));
   set @i = @i + 1;
end;
Github repository about-MSSQL, path: /t-sql/statements/while/counter.sql

See also

T-SQL statements

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1743261767, '3.142.173.6', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQL-Server/T-SQL/statements/while/index(44): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78