TroyMcClure
Technical User
Hi,
In a stored procedure I want to return a certain calculated number from that sp to a VP app that uses an ADO Command.Execute to run it.
I want to return this value to the 'RecordsAffected' argument of the .Execute command (I do NOT want to use an OUT param)
My last statement in the SP is:
Return @thenumber
Go
The number is not returned. The number happens to be the number of recs in one of the tables that's dealt with in the sp, so I tried having the last statement be:
Select * From TheTable
...and this doesn't work either. I had read that the RecordsAffected arg will return the count of the last SQL statement of the sp that it called, or if the .Execute is a simple sql statement and not a stored procedure, it will just return that record count. This does not seem to be the case.
Can anyone tell me how to return a specific number to the RecordsAffected property?
Thanks,
T
In a stored procedure I want to return a certain calculated number from that sp to a VP app that uses an ADO Command.Execute to run it.
I want to return this value to the 'RecordsAffected' argument of the .Execute command (I do NOT want to use an OUT param)
My last statement in the SP is:
Return @thenumber
Go
The number is not returned. The number happens to be the number of recs in one of the tables that's dealt with in the sp, so I tried having the last statement be:
Select * From TheTable
...and this doesn't work either. I had read that the RecordsAffected arg will return the count of the last SQL statement of the sp that it called, or if the .Execute is a simple sql statement and not a stored procedure, it will just return that record count. This does not seem to be the case.
Can anyone tell me how to return a specific number to the RecordsAffected property?
Thanks,
T