About 841,000 results
Open links in new tab
  1. WHILE (Transact-SQL) - SQL Server | Microsoft Learn

    Nov 18, 2025 · In the following example, if the average list price of a product is less than $300, the WHILE loop doubles the prices and then selects the maximum price. If the maximum price …

  2. SQL WHILE LOOP Examples and Alternatives - SQL Server Tips

    May 28, 2025 · In this article, we will look at examples of a SQL Server WHILE loop in T-SQL and discuss alternatives like a CTE and cursor.

  3. SQL WHILE loop with simple examples

    Oct 25, 2019 · This article mentions the basic usage methods of the SQL WHILE Loop with examples and flowcharts

  4. WHILE LoopsSQL Tutorial

    WHILE Loops Structured Query Language (SQL) is primarily a set-based language, but there are scenarios where iterative processing becomes necessary. In SQL Server, the WHILE loop …

  5. SQL Server WHILE Loop (with Examples) - Database.Guide

    Jul 29, 2024 · The WHILE loop in SQL Server is a control-flow statement that allows us to repeatedly execute a block of code as long as a specified condition is true. It’s useful for …

  6. Explore SQL While Loop: Top 5 Best Usage - MadeSimpleMSSQL

    Aug 10, 2025 · Microsoft introduced the SQL While Loop in Transact-SQL (T-SQL) to give developers a procedural control structure for handling repetitive database operations directly in …

  7. SQL While Loop - Tutorial Gateway

    The SQL Server While Loop is used to repeat a block of statements for a given number of times until the given condition is False. The While loop starts with the condition, and if the condition …

  8. SQL Server: WHILE LOOP - TechOnTheNet

    This SQL Server tutorial explains how to use the WHILE LOOP in SQL Server (Transact-SQL) with syntax and examples. In SQL Server, you use a WHILE LOOP when you are not sure …

  9. Understand SQL WHILE loop with examples - dbblogger

    Jan 7, 2026 · SQL Server evaluates the loop condition and executes the specified SQL statements if it is true. If the while condition is false, SQL Server exists the loop. Therefore, the …

  10. SQL Server WHILE - How To Create Loop in SQL Server

    This tutorial shows you how to use the SQL Server WHILE statement to execute a statement block repeatedly based on a specified condition.