Remove-StoredProcedure

Removes a stored procedure.

Syntax

Remove-StoredProcedure [-Name] <String> [[-SchemaName] <String>] [<CommonParameters>]

Description

Removes a stored procedure. Will throw an exception and rollback the migration if the stored procedure doesn't exist.

By default, the stored procedure is assumed to be in the dbo schema. Use the Schema parameter to specify a different schema.

You can conditionally delete a stored procedure only if it exists using the IfExists switch.

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the stored procedure to remove/delete.

true false
SchemaName String

The schema of the stored procedure. Default is dbo.

false false dbo

EXAMPLE 1

Remove-StoredProcedure -Name MySproc

Removes the dbo.MySproc stored procedure.

EXAMPLE 2

Remove-StoredProcedure -Name MySproc -SchemaName rivet

Removes the rivet.MySproc stored procedure.