If I'm creating a C# wrapper for a stored proc, and that sp only returns/selects (not sure) 1 value, should I use return or select at the end of that sp?
This is for t-sql.
If I'm creating a C# wrapper for a stored proc, and that sp only returns/selects (not sure) 1 value, should I use return or select at the end of that sp?
This is for t-sql.
You have a couple choices. You can use an OUTPUT parameter to your stored procedure, a Select statement, or a return value. If I had to guess, I would say an OUTPUT parameter would be the most commonly used given your situation.
Return can only return (no pun intended) an integer and you can only return 1 value
An output parameter can return all datatypes and you can have multiple output parameters per proc
A select statement can return a resultset
It all depends what you want to accomplish in your calling code, I myself prefer output parameters