>The issue is that when I run that stored procedure, from VFP, no record is being inserted into the table and no value is being returned to VFP.
>
>The native VFP command is:
>
>lnReturnCode = SQLExec(lnConnectionID, 'exec Candidate_Insert_Blank ?1000000001', '@lnCandidateID')
>
>I know the stored procedure works, as does the VFP code, as if I removed the line 'set @CandidateID = cast(scope_identity() as int)' from my stored procedure then a new record is added as normal.
>
>Regards
Your EXEC call is wrong. You need to add ?FirstParam ?@SecondParam OUTPUT to your call.
See also
Re: Passing NULL and receiving a value from stored procedure Thread #
1087987
If it's not broken, fix it until it is.
My Blog