O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

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

Creating and Dropping Stored Procedures

Stored procedures are created using the CREATE PROCEDURE statement or the equivalent statement CREATE PROC. When a stored procedure is created, its properties are stored in the sysobjects system table, and its definition (all the statements it contains) in the syscomments system table. A stored procedure is stored in the current database; therefore, if you want to create a stored procedure in other databases, you have to make the other database the current one before creating it (using the USE statement ).

After a stored procedure is created, you can view its parameters and definition using the sp_helptext system stored procedure. You can view its properties using sp_help.

In Listing 8.5, you can see an ...

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