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

--create function [dbo].fn_GetScheduleItem (@ResourceScheduleID uniqueidentifier, @enumId int)
--returns uniqueidentifier
--as
--begin

--return (
--	select
--		ScheduleItemID
--	from
--		[AKUZ].T_SCHEDULE_ITEM with(nolock)
--	where
--		ResourceSchedule = @ResourceScheduleID
--			and
--		DaysOfWeek = @enumId
--)
--end
--GO