Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SauliusSun/b0d79fb2b607f6c31af2 to your computer and use it in GitHub Desktop.
Save SauliusSun/b0d79fb2b607f6c31af2 to your computer and use it in GitHub Desktop.
SQL Server T-SQL drop primary key constraint
IF EXISTS (SELECT 1 FROM [INFORMATION_SCHEMA].[TABLE_CONSTRAINTS] WHERE [CONSTRAINT_TYPE] = 'PRIMARY KEY' AND [TABLE_NAME] = 'EshopInventoryGoalGroup')
BEGIN
ALTER TABLE [EshopInventoryGoalGroup] DROP CONSTRAINT [PK_EshopInventoryGoalGroup]
END
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment