Working with Constraints (Visual Database Tools)
Constraints are rules that the database server enforces for you.
Note
If the table is published for replication, you must make schema changes using the Transact-SQL statement ALTER TABLE or SQL Server Management Objects (SMO). When schema changes are made using the Table Designer or the Database Diagram Designer, it attempts to drop and recreate the table. You cannot drop published objects, therefore the schema change will fail.
For details about working with constraints, see the following topics.
To |
See |
---|---|
Ensure no duplicate values are entered in specific columns |
|
Change the columns that the constraint is attached to, change the constraint name, or set additional properties for the constraint |
|
Remove the requirement for uniqueness for values entered in the column |
|
Create a constraint expression to check data for a condition |
How to: Define Check Constraint Expressions (Visual Database Tools) |
Apply constraints either to new data only or to existing data as well |
How to: Check Existing Data When Creating a Check Constraint (Visual Database Tools) |
Attach a check constraint to a table to specify the data values that are acceptable in one or more columns |
How to: Attach a New Check Constraint to a Table or Column (Visual Database Tools) |
Disable a check constraint when a replication agent inserts or updates data in your table |
How to: Disable Check Constraints for Replication (Visual Database Tools) |
Disable a check constraint when data is added to, updated in, or deleted from a table |
How to: Disable Check Constraints with INSERT and UPDATE Statements (Visual Database Tools) |
Change the constraint expression or the options that enable or disable the constraint for specific conditions |
|
Remove the limitations on data values in a column |
|
Show the properties for a selected check constraint in the Properties window |
How to: Show Check Constraint Properties (Visual Database Tools) |
See Also