hello, I have stored procedure getList(@date datetime)
how programmatically execute stored procedure for differend datetime values.
datetime each month for 3 years.
Any idea, please.
hello, I have stored procedure getList(@date datetime)
how programmatically execute stored procedure for differend datetime values.
datetime each month for 3 years.
Any idea, please.
You can try something like this
DECLARE @StartDate DATETIME,
@EndDate DATETIME
SELECT @StartDate = '01 Jan 2005',
@EndDate = '31 Dec 2007'
WHILE @StartDate <= @EndDate
BEGIN
PRINT @StartDate
EXEC getList(@StartDate)
SET @StartDate = DATEADD(mm, 1, @StartDate)
END