using an array or temp table for a stored procedure in mssql
Posted on 2014-12-10
I have the following declaration in a stored procedure:
DECLARE @EndDate AS DATETIME
SET @EndDate = CAST (@PeriodEnd AS DATE)
SET @EndDate = dbo.fn_LocalTimeToUTC(@EndDate)
I would like to create an array or table that lists all the dates from 1/1/2013 to date:
and use it as the @PeriodEnd date to cycle thru as my stored procedure creates one row of data for each date input.
Thanks in advance for any help.