Drop a view if it exists : Drop View « View « SQL Server / T-SQL






Drop a view if it exists

 


3>
4> IF EXISTS(SELECT *
5>     FROM sys.views
6>     WHERE name = 'StudentGrades' AND
7>     schema_id = SCHEMA_ID('dbo'))
8>     DROP VIEW dbo.StudentGrades
9> GO

1>

 








Related examples in the same category

1.Creating a View Using SQL Script and then drop it