Creating Procedures in SSMS

To create a stored procedure in SSMS, open the object tree for the database in which you want to create the procedure, open the Programmability folder, right-click the Stored Procedures folder, and from the context menu, choose New Stored Procedure. SSMS opens a new query window, populated with code that is based on a default template for stored procedures. Listing 28.2 shows an example of the default template code for a stored procedure that would be opened into a new query window.

Listing 28.2 An Example of a New Stored Procedure Creation Script Generated by SSMS

image

You can modify the template code as necessary to ...

Get Microsoft® SQL Server 2008 R2 Unleashed 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.