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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Performance Boost Up with Return Statement

Author  Topic 

mmkrishna1919
Yak Posting Veteran

95 Posts

Posted - 2012-07-26 : 03:33:15
Hi All,
i came across below two statements while i was reading about SP performance tips.

1.Consider returning the integer value as a RETURN statement instead of returning an integer value as part of a recordset.

2.Using RETURN statement can improve performance as SQL Server will not create a record set.

Can any one Please explain in deatil these two statements,and also please specify in which situations record set will be create by sql server.

Thanks in advance.

M.MURALI kRISHNA

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2012-07-26 : 03:42:18
Homework question?
RETURN values should NEVER be used as business logic. It's purpose is to tell the client the outcome of the code.

You should use OUTPUT parameters if you only want an integer value in return from a stored procedure.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -