Friday, November 04 2005

In that prior example I used a cursor technique that might be alien to some - rather than using a DECLARE CURSOR, I iterated through the records by id.

I came across this at one shop that I did some consulting. At first I approached it with skepticism - It seemed like an unnecessarily quirkly way of doing a cursor - but after several benchmarks I was sold. If the iterating id is indexed (which it often is), the performance advantage will vary between marginal to significant.

 SQL 
   

Reader Comments

Add Comment

Name *:

Email Address:

(your email address is not displayed)
Website:

Comment *:



About the Author
Dennis Forbes Dennis Forbes is a Toronto-based software architect. While focused primarily on the .NET and SQL Server worlds, Dennis frequently ventures outside of this comfort zone into game development and image processing. He has been published in several industry magazines, has been quoted in the Wall Street Journal and has been interviewed by NPR.

He is a vice president and lead software architect at an innovative New York City hedge fund back-office services firm.

Dennis has been working on solutions for the financial, telecommunications, and power generation markets for over 15 years.





 

Dennis Forbes