Disable Primary key

ALTER INDEX statement is used to disable a primary key in SQL Server database.

Syntax:

ALTER INDEX constraint_name ON table_name  

DISABLE;

Example:

Disable the primary key “customer_id” on the table “customers” 

ALTER INDEX cricketers2_pk ON .[dbo].[cricketers2]  

DISABLE;

Output:

SQL Disable primary 1

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *