How to delete column that has a foreign key in MsSql

Scenario :  Delete a column that has a foreign key.

Solution :

1. Step 1 – Delete the foreign key

ALTER TABLE dbo.Sales
DROP CONSTRAINT FK_Client_ClientId

2. Delete the column

ALTER TABLE dbo.Sales
DROP COLUMN ClientId

Lucian Leonte

MCT, MCITP, MCTS

Powered by CodeReview – Let's make it Better!