Remove-CheckConstraint

Removes a check constraint from a table.

Syntax

Remove-CheckConstraint [-TableName] <String> [-SchemaName <String>] [-Name] <String> [<CommonParameters>]

Description

The Remove-CheckConstraint operation removes a check constraint from a table. Check constraints add validation for data in columns.

Parameters

Name Type Description Required? Pipeline Input Default Value
TableName String

The name of the check constraint's table.

true false
SchemaName String

The schema of the table. Default is dbo.

false false dbo
Name String

The name of the check constraint to remove.

true false

EXAMPLE 1

Remove-CheckConstraint 'Migrations' 'CK_Migrations_MigrationID'

Demonstrates how to remove a check constraint from a table. In this case, the CK_Migrations_MigrationID constraint will be removed from the Migrations table.