Chapter 11. Stored Procedures and Functions

Now that you know how to build queries written as single, executable T-SQL statements, it is time to look at how to place these into a stored procedure, or a function, allowing them to be run as often as they are required without the need to be retyped every time. It also allows code to be written that can accept input parameters and return a status, but, most importantly, allow you to improve the security of your database. You will see all of this and more in this chapter.

Stored procedures and functions are two different types of objects that provide different, yet similar, functionality. You will see these differences within the examples, but the main point is that a stored procedure is a set of code ...

Get Beginning SQL Server 2008 Express for Developers: From Novice to Professional 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.