Skip to content

Instantly share code, notes, and snippets.

@mikaelweave
Created November 18, 2015 16:57
Show Gist options
  • Save mikaelweave/b292c0ef44d45932638d to your computer and use it in GitHub Desktop.
Save mikaelweave/b292c0ef44d45932638d to your computer and use it in GitHub Desktop.
Drop Index if it already exists
IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('schema.tablename') AND NAME ='indexname')
DROP INDEX indexname ON SCHEMA.tablename;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment