Skip to content

Instantly share code, notes, and snippets.

@default-kramer
Created December 16, 2015 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save default-kramer/8778347941e5e6fa1e96 to your computer and use it in GitHub Desktop.
Save default-kramer/8778347941e5e6fa1e96 to your computer and use it in GitHub Desktop.
if exists(select * from INFORMATION_SCHEMA.ROUTINES where ROUTINE_NAME = 'DropView')
drop procedure DropView;
go
create procedure DropView
@viewname varchar(99)
as
if exists(select * from INFORMATION_SCHEMA.VIEWS where TABLE_NAME = @viewname)
exec('drop view ' + @viewname);
go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment