Looking for sql-server Answers? Try Ask4KnowledgeBase
Looking for sql-server Keywords? Try Ask4Keywords

Microsoft SQL ServerWHILE loop


Using a WHILE loop or other iterative process is not normally the most efficient way to process data in SQL Server.

You should prefer to use a set-based query on the data to achieve the same results, where possible