scripts

Measure-DbColumnValues.ps1

SYNOPSIS

Provides sorted counts of SQL Server column values.

SYNTAX

Column

Measure-DbColumnValues.ps1 [-Column] <Column> [-Condition <String>] [-MinimumCount <Int32>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

ColumnName

Measure-DbColumnValues.ps1 [-ColumnName] <String> [-Table] <Table> [-Condition <String>]
 [-MinimumCount <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

EXAMPLES

Example 1

PS C:\> 

PARAMETERS

-Column

An SMO column object associated to the database column to examine.

Type: Column
Parameter Sets: Column
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ColumnName

The name of the column to examine in the table associated with the SMO Table object.

Type: String
Parameter Sets: ColumnName
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Table

An SMO table object associated to the database to examine.

Type: Table
Parameter Sets: ColumnName
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Condition

Conditions to be provided as a SQL WHERE clause to filter the column values to examine. Useful for databases that implement “soft deletes” as specific field values.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-MinimumCount

Excludes values with fewer than this number of occurrences.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.SqlServer.Management.Smo.Column to calculate statistics for,

or Microsoft.SqlServer.Management.Smo.Table to select a column from by name.

OUTPUTS

System.Management.Automation.PSCustomObject that describes each counted value.

NOTES

https://www.powershellgallery.com/packages/SqlServer/

https://dbatools.io/