Add-RowGuidCol

Adds the rowguidcol property to a column in a table.

Syntax

Add-RowGuidCol [-SchemaName <String>] [-TableName] <String> [-ColumnName] <String> [<CommonParameters>]

Description

The Add-RowGuidCol operation adds the rowguidcol property to a uniqueidentifier column in a table. A table can only have one rowguidcol column. If a table has an existing rowguidcol column, use Remove-RowGuidCol to remove it before adding a new one.

The Add-RowGuidCol operation was added in Rivet 0.7.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
SchemaName String

The table's schema. Default is dbo.

false false dbo
TableName String

The table's name.

true false
ColumnName String

The name of the column that should get the rowguidcol property.

true false

EXAMPLE 1

Add-RowGuidCol -TableName 'MyTable' -ColumnName 'MyUniqueIdentifier'

Demonstrates how to add the rowguidcol property to a column in a table. In this example, the dbo.MyTable table's MyUniqueIdentifier column will get the propery.

EXAMPLE 2

Add-RowGuidCol -SchemaName 'cstm' -TableName 'MyTable' -ColumnName 'MyUniqueIdentifier'

Demonstrates how to add the rowguidcol property to a column in a table whose schema isn't dbo, in this case the cstm.MyTable table's MyUniqueIdentifier column will get the property.