CHAPTER 17

image

Stored Procedures

by Jonathan Gennick

A stored procedure groups one or more Transact-SQL statements into a logical unit, stored as an object in a SQL Server database. When a stored procedure is executed for the first time, SQL Server creates an execution plan and stores it in the plan cache. SQL Server can then reuse the plan on subsequent executions of this stored procedure. Plan reuse allows stored procedures to provide fast and reliable performance compared to noncompiled and unprepared ad hoc query equivalents.

Image Note  Chapter 19 ...

Get SQL Server T-SQL Recipes, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.