SQL Server Cursor

Cursors are not the best solution when talking about performance but,

If you run into issues with another coding technique and need to get something done quickly, using a cursor may be a viable alternative. It may take longer to process the data, but the coding time might be much less. If you have a one-time process or nightly processing, this could do the trick.

This article contains a good description, example and alternatives to cursors.


SQL Server Execution Plan

Using the Execution Plan in SSMS can answer many questions about why the query you just made runs so slowly. A well constructed T-SQL script should execute reasonably quickly if the database is indexed properly. Since most users have no ability to create nor administer indexes on the databases, the best way to improve performance is to improve the T-SQL script.

Here is a link that tests your ability to use the Execution Plan in SSMS.


It also includes a link to the book that I recommended last year.


Why Scalar Functions Can Be Costly

Scalar Functions are very useful in SQL Server but they need to be used correctly. You can find a simple query takes much too long to run and the only problem is that the function needs to calculate on every row returned. There are many ways to write queries and this article will show you why scalar functions can cause you headaches.