IF EXISTS (SELECT * FROM sys.objects WHERE [name] = N'myTrigger' AND [type] = 'TR') BEGIN DROP TRIGGER [dbo].[myTrigger]; END; GOStored procedure with OBJECT_ID:
IF OBJECT_ID('dbo.mySP') IS NOT NULL DROP PROCEDURE dbo.mySP GOTemp table:
IF OBJECT_ID('tempdb..#myTempTable') IS NOT NULL DROP TABLE #myTempTable GO