O'Reilly logo

Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition by Mark Spenik, Orryn Sledge

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

How to Create a Stored Procedure

To create a stored procedure, use the Create Procedure statement, which has the following syntax:

Create PROCEDURE [owner.]procedure_name [;number][(@parameter1 data_type [VARYING]
 [=default] [OUTPUT] [,@parameter2]... [@parameter1024])] [{FOR REPLICATION} | {WITH
 RECOMPILE} [{[WITH]|[,]}ENCRYPTION]] As SQL Statements

TIP

Use the Stored Procedure Wizard found in Enterprise Manager to create INSERT, DELETE, UPDATE statements for a stored procedure. To access the wizard, click the Run a Wizard toolbar button. Next ...

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