Microsoft SQL Server Stored Procedures

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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;


Got any Microsoft SQL Server Question?