I have a small stored procedure that needs to return a count of records (a single value). What is better to use? A RETURN to return the result or an OUTPUT parameter to return the result?
I'm using C# / .Net to 'talk' to SQL server.
Use an output parameter.
It is less resource intensive to deal with a scalar parameter than a dataset via SELECT (or an OUTPUT clause etc) in the client
And RETURN is limited to int datatype. This doesn't matter here, but generally RETURN would be used for status and errors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With