Removes a foreign key from an existing table that has a foreign key.
Remove-ForeignKey [-TableName] <String> [-SchemaName <String>] [-References] <String> [-ReferencesSchema <String>] [<CommonParameters>]
Remove-ForeignKey [-TableName] <String> [-SchemaName <String>] -Name <String> [<CommonParameters>]
Removes a foreign key to 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 |
References | String | OBSOLETE. Use the |
true | false | |
ReferencesSchema | String | OBSOLETE. Use the |
false | false | dbo |
Name | String | The name of the foreign key to remove. |
true | false |
Remove-ForeignKey 'Cars' -Name 'FK_Cars_Year'
Demonstrates how to remove a foreign key that has a name different than Rivet's derived name.