Creating faster cursors in SQL Server

Using SQL Server cursors can be slow. However there is a way to speed them up.

This tip was submitted to the SearchWin2000.com tip exchange by member Gilbert Segal. Please let other users know...

how useful it is by rating it below.


Using SQL Server cursors can be slow. However there is a way to speed them up. If you don't need to use all of the columns in a table, consider putting in only the columns you need in the SELECT statement. Instead of using "SELECT * ," use "SELECT col1,col2,etc."

I put in 20 columns in a query instead of using "*" and having it use all 95 columns. The cursor ran six times faster.

This was last published in March 2005

Dig Deeper on Microsoft SQL Server Performance Monitoring and Tuning

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close