Type of loops in sql server?

Please tell me all the types of loops that we can use in SQL Server 2008. An example of each will be a good one.

+2
source share
1 answer

You should avoid loops when you can, try to find a set-based approach. You will get more performance this way.

This article describes why:

http://www.techrepublic.com/blog/datacenter/avoiding-cursors-with-sql-server-2005/412

If you really need loops:

http://www.techrepublic.com/blog/datacenter/comparing-cursor-vs-while-loop-performance-in-sql-server-2008/1741

+6
source

Source: https://habr.com/ru/post/1539069/


All Articles