Try this too:
insert into [dbo].ONLINEFY2020
exec dbo.[ONLINE_IMPORT] @date = @TxnDate
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
Try this too:
insert into [dbo].ONLINEFY2020
exec dbo.[ONLINE_IMPORT] @date = @TxnDate
select cast(Date_fld as date)
The column name "Date_fld" don't match with the table definition/don't exist.
So it's from a different table and by the error message it's type "integer", right?