Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Raise an exception from within a SP
Message
From
14/09/2006 02:32:44
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01076224
Message ID:
01153599
Views:
23
>>>>>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...

put this code into a SQLEXEC()
TEXT TO sqlCmd
DECLARE @return INT
EXEC @return = [db].[user].[sp]
SELECT @return "code"
ENDTEXT

sqlexec(h,m.sqlCmd,"return")
? return.code
If the sp retunr some recordset,
set batch = .F. and execute the download recordset-by-recorset.
Previous
Reply
Map
View

Click here to load this message in the networking platform