Get-SqlIndex
Gets an SMO Index object.
Syntax
Get-SqlIndex [-table] <Object> [<CommonParameters>]
Detailed Description
The Get-SqlIndex function gets a collection of SMO Index objects for the specified table or view.
Related Commands
Parameters
Name |
Description |
Required? |
Pipeline Input |
Default Value |
table |
|
true |
true (ByValue) |
|
Input Type
Microsoft.SqlServer.Management.Smo.Table or
Microsoft.SqlServer.Management.Smo.View
You can pipe SMO objects to Get-SqlIndex
Return Values
Microsoft.SqlServer.Management.Smo.Index
Get-SqlIndex returns a Microsoft.SqlServer.Management.Smo.Index object.
Notes
Additional properties including the database, server and extended properties are included in the output.
Examples
EXAMPLE 1
Get-SqlDatabase "Z002\sql2k8" "pubs" | Get-SqlTable -name "authors" | Get-SqlIndex
This command gets a collection of SMO Index objects for the authors table.