我收到此错误:
最大递归 100 在语句完成之前已经用完
当我运行此功能时:
WITH allDays AS (
SELECT @DateEarly AS date
UNION ALL
SELECT DATEADD(dd, 1, date) as date
FROM allDays s
WHERE DATEADD(dd, 1, date) <= @DateLate
)
SELECT *
from allDays
where dbo.isFestivo(date)>0
我试图附加这个选项:
OPTION (MAXRECURSION 200);
但我在“选项”字之前收到错误 156。你知道为什么吗?