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


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