Add-View

Creates a new view.

Syntax

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

Description

Creates a new view.

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the view.

true false
SchemaName String

The schema name of the view. Defaults to dbo.

false false dbo
Definition String

The definition of the view. Everything after the create view [schema].[name] clause.

true false

EXAMPLE 1

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

Creates a view to read all the migrations from Rivet's Migrations table. Don't do this in real life.