Udostępnij za pośrednictwem


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

How to: Create Unique Constraints (Visual Database Tools)

Change the columns that the constraint is attached to, change the constraint name, or set additional properties for the constraint

How to: Modify Unique Constraints (Visual Database Tools)

Remove the requirement for uniqueness for values entered in the column

How to: Delete Unique Constraints (Visual Database Tools)

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

How to: Modify Check Constraints (Visual Database Tools)

Remove the limitations on data values in a column

How to: Delete Check Constraints (Visual Database Tools)

Show the properties for a selected check constraint in the Properties window

How to: Show Check Constraint Properties (Visual Database Tools)

See Also

Other Resources

Working with Keys (Visual Database Tools)
Working with Relationships (Visual Database Tools)

Help and Information

Getting SQL Server 2005 Assistance