O'Reilly logo

Microsoft SQL Server 2012 T-SQL by Debra Aaron, Tom Coffing

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

Chapter 17 – Stored Procedures

“Freedom from effort in the present merely means that there has been effort stored up in the past.”

- Theodore Roosevelt

Creating a Stored Procedure

image

The CREATE PROCEDURE command will create a stored procedure. The above procedure will return information about students from the Student_Table. The answer set is sorted by freshman, sophomore, junior and then senior. This procedure is created in the dbo schema. The letters dbo stand for “database owner.” The dbo schema is one that is always present in every database, and it is an excellent standard repository for stored procedures.

Executing a Stored Procedure

You SELECT ...

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