Cursors are still performance killers because of the row-by-row processing. But there are certain class of problems or tasks that needs the use of cursors. For example, if you have to perform an administrative task on all databases in a server then you may have to use a cursor loop to through each database and run a command. There are certain behavior changes in SQL Server 2005 for cursors that may or may not introduce performance issues in your existing code. It depends on your current usage and type of cursor for example. See the link below for the details:
http://msdn2.microsoft.com/en-us/ms143359(SQL.90).aspx
So the recommendation is that you should try to perform set-based operations as far as possible because the server can do this very efficiently.
|||Thanks for the info. The link has great reference information on behavior changes on cursors as well as other features in SQL Server 2005.
No comments:
Post a Comment