Error:-
WITH DateTable
AS
(
SELECT CAST('2014-01-30 17:43:00.000' as Date) AS [DATE]
UNION ALL
SELECT DATEADD(dd, 1, [DATE]) FROM DateTable
WHERE DATEADD(dd, 1, [DATE]) <= cast('2016-05-10 05:47:03.000' as Date)
)
SELECT dt.[DATE] FROM [DateTable] dt
Msg 530, Level 16, State 1, Line 1
The statement terminated. The maximum recursion 100 has been exhausted before statement completion.
Solution:-
WITH DateTable
AS
(
SELECT CAST('2014-01-30 17:43:00.000' as Date) AS [DATE]
UNION ALL
SELECT DATEADD(dd, 1, [DATE]) FROM DateTable
WHERE DATEADD(dd, 1, [DATE]) <= cast('2016-05-10 05:47:03.000' as Date)
)
SELECT dt.[DATE] FROM [DateTable] dt
option (maxrecursion 0);
WITH DateTable
AS
(
SELECT CAST('2014-01-30 17:43:00.000' as Date) AS [DATE]
UNION ALL
SELECT DATEADD(dd, 1, [DATE]) FROM DateTable
WHERE DATEADD(dd, 1, [DATE]) <= cast('2016-05-10 05:47:03.000' as Date)
)
SELECT dt.[DATE] FROM [DateTable] dt
Msg 530, Level 16, State 1, Line 1
The statement terminated. The maximum recursion 100 has been exhausted before statement completion.
Solution:-
WITH DateTable
AS
(
SELECT CAST('2014-01-30 17:43:00.000' as Date) AS [DATE]
UNION ALL
SELECT DATEADD(dd, 1, [DATE]) FROM DateTable
WHERE DATEADD(dd, 1, [DATE]) <= cast('2016-05-10 05:47:03.000' as Date)
)
SELECT dt.[DATE] FROM [DateTable] dt
option (maxrecursion 0);
Im impressive with your blog, keep writing like this
ReplyDeletesuch an amazing blog. If you want to buy Waterproof Baby Sheet then click here.
Nice blog, keep writing like this
ReplyDeleteI must recommend your blog, that is such a nice blog and if you want to buy Fridge Mats then click on the link.
Nice blog, keep writing like this
ReplyDeleteFind here online price details of companies selling Mattress Cover Waterproof. Get info of suppliers, manufacturers, exporters, traders of Mattress Cover Near Me for buying in India.
Nice blog, keep writing like this
ReplyDeleteBuy Milwaukee at low prices in UK. Select from range of home improvement tools & Milwaukee UK of all brands from tools4trade.co.uk
Milwaukee
Milwaukee UK
Milwaukee Power Tools
Milwaukee Fuel
Milwaukee UK Cordless
Corded Power Tools
Milwaukee power tools UK