Javatpoint Logo
Javatpoint Logo

Disable Foreign Key

ALTER TABLE statement is used to disable a foreign key. Once you have created a foreign key in SQL Server, you may get a situation where you are want to disable the foreign key, use the following syntax.


Parameter explanation

table_name: It specifies the name of the table where the foreign key has been created.

fk_name: It specifies the name of the foreign key that you wish to disable.


Create a foreign key by creating two tables "products3" and "inventory" table.

Now use the following command to disable the foreign key where foreign constraint is:



SQL Disable 1

Now the foreign key is disabled.

Next TopicDrop Foreign Key

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA