O'Reilly logo

Writing Stored Procedures for Microsoft SQL Server by Matthew Shepker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Problems with Stored Procedures

Nearly all programming languages have little problematic things. I can't point out all these things in this chapter—you will have to find and take care of a lot of them on your own. What I can do is point out some of the ones that I have found so that you can avoid them.

Some of the big problems I have found in T-SQL have to do with concurrency. These problems usually come around due to issues introduced by the developer, such as long-running stored procedures, but manifest themselves as problems with the database itself, such as a large amount of blocking. The following sections hit on two of these problems: excessive blocking and sequential numbering in a table.

Blocking

As you know, when data modification is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required