I am using a cross apply in a stored procedure to expand range of dates to individual dates.
select *
from #tbl_tempOutPut as st
cross apply dbo.explodeDates(st.startdate,st.enddate) as dt
Table #tbl_tempOutPut looks like this:
ID Des startdate enddate kindex
A att 2003-12-04 2004-01-03 1
A att 2004-01-04 2004-02-03 1
The function dbo.explodeDates is a previous accepted answer.
My problem is that the query runs forever and does not return.
Many thanks,