ALTER PROCEDURE [dbo].[sp_ChkHoliday]
@Date AS DATETIME
AS
BEGIN
SET NOCOUNT ON;
declare @TmpResult bit;
set @Date=convert(datetime,convert(varchar,@date,1))
SELECT @TmpResult= CASE WHEN DATEPART(DW, @date + @@DATEFIRST - 1) > 5 THEN 1
ELSE 0 END
if @TmpResult = 0
begin
select @TmpResult = IsNonWorkDate
FROM Table****
where TimeOfDay = @Date
end
select Result = case when @TmpResult = 1 then 'Yes' else 'No' end
END
Tag : Ms SQL Server 2005, Ms SQL Server 2008, Ms SQL Server 2012, Ms SQL Server 2014, Ms SQL Server 2016