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

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

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

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

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

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

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].[TI_History_Price]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
drop trigger [dbo].[TI_History_Price]

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

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].[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].[Create_Sanad_Ghest]')
                    AND OBJECTPROPERTY(id, N'IsProcedure') = 1 )
    DROP PROCEDURE [dbo].[Create_Sanad_Ghest]

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

IF EXISTS ( SELECT  *
            FROM    dbo.sysobjects
            WHERE   id = OBJECT_ID(N'[dbo].[Sodor_Ghest]')
                    AND OBJECTPROPERTY(id, N'IsProcedure') = 1 )
    DROP PROCEDURE [dbo].[Sodor_Ghest]

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

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

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

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

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]

