Get-SqlView
Gets an SMO View object.
Syntax
Get-SqlView [-database] <Database> [[-name] <String>] [<CommonParameters>]
Detailed Description
The Get-SqlView function gets a collection of SMO View objects for the specified database.
Related Commands
Parameters
Name |
Description |
Required? |
Pipeline Input |
Default Value |
database |
|
true |
true (ByValue) |
|
name |
|
false |
false |
|
Input Type
Microsoft.SqlServer.Management.Smo.Database
You can pipe SMO database objects to Get-SqlView
Return Values
Microsoft.SqlServer.Management.Smo.View
Get-SqlView returns a Microsoft.SqlServer.Management.Smo.View object.
Notes
Additional properties including the database, server and extended properties are included in the output.
Examples
EXAMPLE 1
Get-SqlView $(Get-SqlDatabase "Z002\sql2K8" pubs)
This command gets a collection of SMO View objects for SQL Server Z002\SQL2K8, pubs database.
EXAMPLE 2
Get-SqlDatabase "Z002\sql2K8" | Get-SqlView
This command gets a collection of SMO View objects for all user databases on SQL Server Z002\SQL2K8.
EXAMPLE 3
Get-SqlDatabase "Z002\sql2K8" pubs | Get-SqlView -name "titleview"
This command gets an SMO View object for the titleview view in the pubs database on SQL Server Z002\SQL2K8.