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 |
denis_the_thief
Aged Yak Warrior
596 Posts |
Posted - 2013-04-03 : 16:03:30
|
I was looking at this stored proc and was confused over this code. Here is a snippet:alter PROCEDURE [xxx] @Lang tinyint = 0 ,@CurrUserID varchar(10) = nullASBEGIN DECLARE @errnum int ... //I removed several lines exec @errnum = _OrganizationDocketRate_Fetch @Lang, @CurrUserIDENDRETURN @@ERRORGO What I think is that there is no point to @errnum. Is this true? i.e. I don't see how it can be returned. |
|
ScottPletcher
Aged Yak Warrior
550 Posts |
Posted - 2013-04-03 : 16:11:12
|
Quite right; in that code, @errnum is not used, but it will still contain the value RETURNed by the _OrganizationDocketRate_Fetch procedure. |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-04-03 : 16:13:59
|
Instead of "RETURN @@ERROR", you can use "RETURN @@errnum", if that is indeed what you want to do. But, as written, the value of @errnum is assigned but not used, so there is no point to having it. |
|
|
denis_the_thief
Aged Yak Warrior
596 Posts |
Posted - 2013-04-03 : 16:34:52
|
Thanks |
|
|
|
|
|