Dela via


Working with Keys (Visual Database Tools)

A primary key is a constraint that assures that each table contains no duplicate rows. A foreign key is a constraint that enforces referential integrity.

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 keys, see the following topics.

How to: Create Primary Keys (Visual Database Tools)

How to: Modify Primary Keys (Visual Database Tools)

How to: Delete Primary Keys (Visual Database Tools)

How to: Modify Foreign Key Relationships (Visual Database Tools)

How to: Delete Foreign Key Relationships (Visual Database Tools)

How to: View Foreign Key Properties (Visual Database Tools)

How to: Disable Foreign Key Constraints for Replication (Visual Database Tools)

How to: Disable Foreign Key Constraints with INSERT and UPDATE Statements (Visual Database Tools)