Get-SqlIndexFragmentation

Returns index fragmentation.

Syntax

Get-SqlIndexFragmentation [-index] <Index> [<CommonParameters>]

Detailed Description

The Get-SqlIndexFragmentation function returns index fragmentation of the specified index.

Related Commands

* Get-SqlIndexFragmentation

Parameters

Name Description Required? Pipeline Input Default Value
index    true  true (ByValue)   

Input Type

None You can pipe SMO Index objects to Get-SqlIndexFragmentation

Return Values

System.Data.DataRow Get-SqlIndexFragmentation returns an array of System.Data.DataRow.

Notes

Performs the equivalent of DBCC SHOWCONTIG

Examples

EXAMPLE 1

Get-SqlDatabase "Z002\sql2k8" "pubs" | Get-SqlTable -name authors | Get-SqlIndex | Get-SqlIndexFragmentation
This command gets index fragmentation of the indexes of the authors table