drop view if exists code example
Example 1: t-sql delete view if exists
if exists(select 1 from sys.views where name='tst' and type='v')
drop view tst;
go
create view tst
as
select * from test
Example 2: sql drop view if exists
DROP VIEW IF EXISTS yourview;