CHAPTER 18

image

Stored Procedures—Part 1

Stored procedures—or SPs, as some lovingly call them—are likely to become your best friends as you spend more and more time with SQL Server. It is not uncommon to come across databases that contain hundreds of stored procedures—they’re just so darned flexible! In this chapter, we’ll find out exactly why stored procedures are so useful, and we’ll create a couple of SPs of our own.

What Are Stored Procedures, and Why Should I Use Them?

A stored procedure is a repeatable piece of code. You’d be forgiven for thinking, “Hold everything!”—isn’t that what a function does? Well yes, it is. But a function is intended ...

Get Introducing SQL Server now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.