Remove-View

Removes a view.

Syntax

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

Description

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

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

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

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the view to remove/delete.

true false
SchemaName String

The schema of the view. Default is dbo.

false false dbo

EXAMPLE 1

Remove-View -Name MyView

Removes the dbo.MyView view.

EXAMPLE 2

Remove-View -Name MyView -SchemaName rivet

Removes the rivet.MyView view.