Stored Procedures

Download sql-server eBook

Introduction

In SQL Server, a procedure is a stored program that you can pass parameters into. It does not return a value like a function does. However, it can return a success/failure status to the procedure that called it.

Syntax

  • CREATE { PROCEDURE | PROC } [schema_name.]procedure_name
  • [ @parameter [type_schema_name.] datatype
  • [ VARYING ] [ = default ] [ OUT | OUTPUT | READONLY ]
  • , @parameter [type_schema_name.] datatype
  • [ VARYING ] [ = default ] [ OUT | OUTPUT | READONLY ] ]
  • [ WITH { ENCRYPTION | RECOMPILE | EXECUTE AS Clause } ]
  • [ FOR REPLICATION ]
  • AS
  • BEGIN
  • [declaration_section]
  • executable_section
  • END;

Related Examples

Stats

579 Contributors: 11
Thursday, April 13, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook