From the course: SQL Server 2008 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Introduction to stored procedures

Introduction to stored procedures - SQL Server Tutorial

From the course: SQL Server 2008 Essential Training

Start my 1-month free trial

Introduction to stored procedures

All these functions that we have are great and they're very useful and you'll use them all the time, but you probably won't end up writing a lot of them. However, spend any time with SQL Server and you will write stored procedures. A stored procedure is simply a chunk of SQL wrapped up, given a name, and then stored in the database. It can then be executed multiple times from SQL Server Management Studio, called from an application. It's available to anyone who can get to the database. And these will be the main way that you reuse SQL. Talk to developers and database administrators and they'll tell you that almost all of the SQL they write is intended for a stored procedure. Now we've written a lot of SQL in the past few hours, but if I'd wanted to save and reuse any of this I simply would have just have the option to go to my File menu and save this as a text file on my desktop. Well, that's fine for some personal learning and testing. But when you write some more complex SQL that…

Contents