About 3,500,000 results
Open links in new tab
  1. Syntax of for-loop in SQL Server - Stack Overflow

    May 20, 2011 · SQL is a very different language compared to what you're used to. It's focused on what, not how. You tell SQL Server what results you want, and let it figure out how to produce …

  2. SQL FOR Loop Alternatives - SQL Server Tips

    Dec 13, 2021 · Learn different ways to create FOR Loops using T-SQL such as using WHILE loops, cursors, tally tables and more.

  3. SQL Server: FOR LOOP - TechOnTheNet

    Learn how to simulate the FOR LOOP in SQL Server (Transact-SQL) with syntax and examples. In SQL Server, there is no FOR LOOP. However, you simulate the FOR LOOP using the …

  4. WHILE (Transact-SQL) - SQL Server | Microsoft Learn

    Nov 18, 2025 · Sets a condition for the repeated execution of a SQL statement or statement block. The statements are executed repeatedly as long as the specified condition is true.

  5. For Loop in SQL Server Stored Procedure

    Mar 7, 2024 · First, I want to say that SQL Server doesn’t have ‘FOR LOOP’, but you can achieve similar iterative processing using the ‘WHILE’ loop. So, instead of ‘FOR LOOP’, you will use …

  6. Loops in SQL Server - TutorialsTeacher.com

    In SQL Server, a loop is the technique where a set of SQL statements are executed repeatedly until a condition is met.

  7. How to Loop Through a Set of Records in SQL Baeldung on SQL

    Nov 29, 2024 · SQL provides a few methods to help us loop through records in database management systems like MySQL, SQL Server, and PostgreSQL. In this tutorial, we’ll explore …

  8. Learn SQL: Intro to SQL Server loops - SQL Shack

    Jun 15, 2020 · Loops are one of the most basic, still very powerful concepts in programming – the same stands for SQL Server loops. Today, we’ll give a brief info on how they function and …

  9. How do I loop through a set of records in SQL Server?

    Often code can be re-written in a set based manner (i.e. avoid loops). If you're adamant you want to perform an RBAR operation (simple-talk.com/sql/t-sql-programming/…) then a cursor is the …

  10. Syntax of for-loop in SQL Server - JanBask Training

    Apr 17, 2025 · In SQL Server, the FOR loop is used for iterating over a range of numbers or through a result set. However, it is not a native feature in SQL Server like in traditional …