Add-StoredProcedure

Creates a new stored procedure.

Syntax

Add-StoredProcedure [-Name] <String> [-SchemaName <String>] [-Definition] <String> [<CommonParameters>]

Description

Creates a new stored procedure.

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the stored procedure.

true false
SchemaName String

The schema name of the stored procedure. Defaults to dbo.

false false dbo
Definition String

The store procedure's definition, which is everything after the create procedure [schema].[name] clause.

true false

EXAMPLE 1

Add-StoredProcedure -SchemaName 'rivet' 'ReadMigrations' 'AS select * from rivet.Migrations'

Creates a stored procedure to read the migrations from Rivet's Migrations table. Note that in real life, you probably should leave my table alone.