Last active
August 29, 2015 14:25
-
-
Save miguelludert/ef334be8b2b4f44a3a8f to your computer and use it in GitHub Desktop.
Drop if exists (SQL SERVER)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF NOT EXISTS(SELECT * FROM sys.columns WHERE Name = N'columnName' AND Object_ID = Object_ID(N'tableName')) | |
BEGIN | |
-- Column Exists | |
END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS (SELECT * FROM sys.procedures WHERE object_id = OBJECT_ID(N'[procname]')) | |
drop procedure [procname] | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[viewname]')) | |
drop view [viewname] | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment