Get-SqlTable

Gets an SMO Table object.

Syntax

Get-SqlTable [-database] <Database> [[-name] <String>] [<CommonParameters>]

Detailed Description

The Get-SqlTable function gets a collection of SMO Table objects for the specified database.

Related Commands

* Get-SqlTable

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-SqlTable

Return Values

Microsoft.SqlServer.Management.Smo.Table Get-SqlTable returns a Microsoft.SqlServer.Management.Smo.Table object.

Notes

Additional properties including the database, server and extended properties are included in the output.

Examples

EXAMPLE 1

Get-SqlTable $(Get-SqlDatabase "Z002\sql2K8" pubs)
This command gets a collection of SMO Table objects for SQL Server Z002\SQL2K8, pubs database.

EXAMPLE 2

Get-SqlDatabase "Z002\sql2K8" | Get-SqlTable
This command gets a collection of SMO Table objects for all user databases on SQL Server Z002\SQL2K8.

EXAMPLE 3

Get-SqlDatabase "Z002\sql2K8" pubs | Get-SqlTable -name "authors"
This command gets an SMO Table object for the authors table in the pubs database on SQL Server Z002\SQL2K8.