Cursor in sql10/16/2023 Keep in mind SQL Server, as a modern RDBMS system, performs much better with set operations. Study carefully what you want to achieve on case by case basis before using a cursor. A cursor is flexible in that it provides a window, or subset, of data and that allows manipulation of the data in various ways. For example, a cursor is ideal for row by row processing that can’t be accomplished by set based operations. Now there are certain scenarios where using a cursor makes sense. You have probably heard many times, from different sources, that as a best practice avoid using TSQL cursors.ĭuring a recent visit to a partner we ran into a common cursor case, which I wanted to use as an example to demonstrate why you should avoid TSQL cursors in most cases, and how to convert cursor logic to simple set join operations.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |