if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_CreateParByReferDay]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_CreateParByReferDay]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Sodor_Factor_Drug]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Sodor_Factor_Drug]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SearchKala]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[SearchKala]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Ti_DrugHavaleh_Parvande]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
drop trigger [dbo].[Ti_DrugHavaleh_Parvande]