Hi All
Not sure where I am going wrong. Any assistance will be off great help
I am trying to run a stored procedure against a cursor which will insert a one year record into a table
This is my SQL query:-
declare @TxnDate Date
declare cur Cursor local for
select cast(Date_fld as date) from dbo.Calendar where cast(date_fld as date) between '2020-01-26' and '2021-01-30'
open cur
fetch next from cur into @TxnDate
While @@FETCH_STATUS = 0
Begin
insert into [dbo].ONLINEFY2020
Exec dbo.[ONLINE_IMPORT] @TxnDate
Fetch next from cur into @TxnDate
End
close cur
deallocate cur
Here is my table definition

and here is the error i am getting

Any assistance is appreciated
Thanks
Farhan Jamil