Update-StoredProcedure

Updates an existing stored procedure.

Syntax

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

Description

Updates an existing stored procedure.

Related Commands

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 alter procedure [schema].[name] clause.

true false

EXAMPLE 1

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

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