If the object does not exists, DIE will not fail and execution will continue.
DIE :) ) statements in SQL Server 2016.įrom SQL Server 2016 CTP3 you can use new DIE statements instead of big IF wrappers, e.g.: I don't like these, and if you also don't like them, then you might try new DROP IF EXISTS (a.k.a. IF EXISTS (SELECT * FROM sys.triggers WHERE name = 'trProductInsert') IF OBJECT_ID('dbo.Product, 'U') IS NOT NULL In SQL Server 2016 CTP3 objects can DIE (DROP IF EXISTS)ĭo you like to write following conditional DROP statements: