How to set the maximum number of result sets displayed in the grid

  • When I execute sp_MSforeachtable @command1="EXEC sp_spaceused '?'"

    I get this error: The query has exceeded the maximum number of result sets that can be

    displayed in the results grid. Only the first 100 result sets are

    displayed in the grid.

    When I looked at TOOLS\OPTIONS\QUERY RESULTS\RESULTS TO GRID, my non-XML data size is 65,535 (there is no XML stored in the output)

    How can I increase the the number or Results displayed? There are only 137 tables in the database I am looking at; can I specify this number somewhere? Please advise

    Thanks!

    dkg

  • You might want to try this instead:

    CREATE TABLE #space (name sysname, rows int, reserved varchar(50), data varchar(50), index_size varchar(50), unused varchar(50))

    EXEC sp_MSforeachtable @command1='INSERT INTO #space EXEC sp_spaceused ''?'''

    SELECT * FROM #space

    DROP TABLE #space

    Best Regards,

    Chris Büttner

  • Thanks Christian! That was exactly what I needed! 😀

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply