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

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


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


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



if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Tu_Tolid]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
Drop Trigger [dbo].[Tu_Tolid]

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

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

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

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

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

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]




