Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server 2016 (13.x) and later versions
Azure SQL Database
Azure SQL Managed Instance
SQL database in Microsoft Fabric
You can delete a foreign key constraint in SQL Server by using SQL Server Management Studio or Transact-SQL. Deleting a foreign key constraint removes the requirement to enforce referential integrity.
Foreign keys reference keys in other tables, for more information, see Primary and Foreign Key Constraints.
Requires ALTER permission on the table.
In Object Explorer, expand the table with the constraint and then expand Keys.
Right-click the constraint and then select Delete.
In the Delete Object dialog box, select OK.
In Object Explorer, connect to an instance of Database Engine.
On the Standard bar, select New Query.
Copy and paste the following example into the query window and select Execute.
USE AdventureWorks2022;
GO
ALTER TABLE dbo.DocExe
DROP CONSTRAINT FK_Column_B;
GO
For more information, see ALTER TABLE (Transact-SQL).
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Design a Performant Data Model in Azure SQL Database with Azure Data Studio - Training
Learn how to create a data model, tables, indexes, constraints, and use data types with Azure data studio.