>>>>did they replace goto with try/catch in t-sql or you are talking about writing sprocs in vb/c#?
>>>
>>>try endtry catch
>>>
>>>>im doing most of the work in oracle/pl-sql and i like this language much better than t-sql.
>>>
>>>sql2005's t-sql reduce the gap, but p-sql is some years ahead.
>>
>>How do you return Return code into VFP from SP?
>>
>>Thanks.
>
>
>DECLARE @return INT
>
>EXEC @return=[db].[user].[procedure]
>
>SELECT @return
>
>No, I meant in VFP code how can you get return. Anyway, I found an answer >in Sergey Berezniker's reply, but I lost the thread again...
Try,
SP side-
if @@error<>0 return -1
or
if @@error<>0
begin
raiserror(' Customized error message here',19,1) with log
return -1
end
VFP side -
if sqlexec(nsqlhnd,"exec SP_name")<0
AERROR(a_err)
* DISPLAY MEMORY LIKE a_err
lcerr=STREXTRACT(a_err(2),"[SQL Server]")
Messagebox(lcerr,16,"")
endif
Steven