/****** Object:  StoredProcedure [dbo].[P_GetHolidays]    Script Date: 03/10/2018 09:47:59 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[P_GetHolidays]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[P_GetHolidays]
GO

/****** Object:  StoredProcedure [dbo].[P_GetHolidays]    Script Date: 03/10/2018 09:47:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO





CREATE PROCEDURE [dbo].[P_GetHolidays] 
AS
BEGIN

	SET NOCOUNT ON;
	
	declare @count int=0;
	
	
	SELECT @count=count(*) FROM T_Sys_WorkCalendar 
		WHERE getdate() between F_DateId and DATEADD(dd,1,F_DateId) 
			AND F_WorkingFlag=1 
			AND Convert(varchar(20),getdate(),108)>=Convert(varchar(20),'08:00:00',108) 
			AND Convert(varchar(20),getdate(),108)<=Convert(varchar(20),'18:00:00',108)
	
	
	
	select @count as HolidayVerify
END




GO


