Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
daman
Yak Posting Veteran
72 Posts |
Posted - 2007-11-23 : 17:48:43
|
Is there some example of how i can add a return status into my stored procedure to have an extra field where I can verify if it runs successfully 1 if success-1 if error (server, etc)0 if empty record returnThanks |
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2007-11-23 : 18:49:14
|
Right click script procedure as execute to new query window for syntax that does this automatically (return status = 0 if successful, 1 if not) Poor planning on your part does not constitute an emergency on my part. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-23 : 21:56:04
|
You can either use RETURN or OUTPUT parameters to achieve this. I prefer to use RETURN to indicate success and failure. IMO, OUTPUT parameters are more for providing data back to the application.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|