Removes a primary key from a table.
Remove-PrimaryKey [-TableName] <String> [-SchemaName <String>] [<CommonParameters>]
Remove-PrimaryKey [-TableName] <String> [-SchemaName <String>] [-Name] <String> [<CommonParameters>]
The Remove-PrimaryKey
operation removes a primary key from a table.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
TableName | String | The name of the table. |
true | false | |
SchemaName | String | The schema name of the table. Defaults to |
false | false | dbo |
Name | String | The name of the primary key to remoe. |
true | false |
Remove-PrimaryKey 'Cars' -Name 'Car_PK'
Demonstrates how to remove a primary key whose name is different than the derived name Rivet creates for primary keys.