Home Forums SQL Server 2005 T-SQL (SS2K5) is it a good practice to return multiple datasets in a stored procedure RE: is it a good practice to return multiple datasets in a stored procedure

  • I use stored procedures to return multiple record sets fairly often. Sometimes the data is formally related; sometimes not. It depends on the application. I use this only when the application needs multiple sets of data all at one time. For example in a web page that has multiple gird views, etc.
    My latest usage was in an application that creates text output files for import into our financial system. Each of the imports references different tables in the financial system and uses different formats for the import. By pulling the tables all in one SP, I only make one call to SQL and the server returns my data in one trip. Then in my code I process the returned results as necessary.