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

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


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


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


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

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


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


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

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

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


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


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


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


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


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


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


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


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


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


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


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


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


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

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


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


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


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


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

