I want to Mark holidays from the database and auto mark weekends to my attendance system. i have created a database for the holidays for the current year and i want to use that data to mark the holidays for the current years

Here is My Stored Procedure:
SQL
@STARTDATE DATETIME ='2021-07-01',
@ENDDATE DATETIME='2021-07-31',
@message varchar(200)=null outputAS
BEGIN
WITH DATERANGE AS
( SELECT DT =DATEADD(DD,0, @STARTDATE) WHERE DATEADD(DD, 1, @STARTDATE) ''''
' EXEC (@QUERY) DROP TABLE #TMP_DATESI tried a lot, but couldn't find how to solve this.


Answers
Know the answer? Post it. Somebody with the same question will find it here.