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






3> IF OBJECT_ID('dbo.VCustsWithOrders') IS NOT NULL
4>   DROP VIEW dbo.VCustsWithOrders;
5> GO








16.5.DROP VIEW
16.5.1.The syntax of the DROP VIEW statement
16.5.2.Drop a view if it exists
16.5.3.Using the DROP statement wipes the slate clean, and reinitializes properties and security permissions: