October 2, 2012 at 10:02 am
Hi,
If I have a stored procedure that only checks if a customer exists (simple case) it's better to use an OUTPUT parameter or return a data row?
When returning single rows of data what's the best practice for stored procedures? OUTPUT parameters or resultsets?
Thanks,
Pedro
October 2, 2012 at 10:09 am
PiMané (10/2/2012)
Hi,If I have a stored procedure that only checks if a customer exists (simple case) it's better to use an OUTPUT parameter or return a data row?
When returning single rows of data what's the best practice for stored procedures? OUTPUT parameters or resultsets?
Thanks,
Pedro
1. If your procedure returns just a bit Yes/No flag, I would suggest using OUTPUT (BIT type) parameter or RETURN value (INT type). It would be overkill to return it as resultset.
2. When you need single or multiple ROW of data, the best practice is to return it as resultset.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply