Quote:
quote:Originally posted by SQLScott
You can run multiple queries in a stored procedure but a stored procedure can return only a single result set.
|
This is not true.
A stored procedure can certainly return multiple resultsets. Execute such an SP in Query Analyzer and you'll see each resultset listed one after the other.
As for client consumer code, how those those resultsets are handled depends on the mechanisms and data providers chosen. For example, in .NET terms, if a DataReader is used then the DataReader.NextResultSet method will advance to each resultset in turn. Or, populating a DataSet from the stored procedure via a DataAdapter will create one DataTable in the DataSet for each resultset returned.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com