Saturday, November 12, 2011

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

If you get this error message in your SQL Server then read on:
In "Results to Grid" format one cannot display more than 100 resultset.  So just change the result format to either "Result to Text" or "Result to File" option
Example to reproduce this error:
Step 1: Ctrl + D (setting to Grid format for demo purpose)
Step 2: Try to print the current datetime for 101 times for example
Select GetDate()
Go 101
You would see the error as we are trying to display more than 100 resultset in a "Result to Grid" format.
Just in case you thought 100 is the limitation of GO command in SQL Server try the below script
Create table TestTable
SLno int identity,
Firstname varchar(50)
Insert into TestTable values ('Testing')
Go 101

For easy reference:
1. Ctrl + T :: Result will be displayed in Text mode
2. Ctrl + D :: Result will be displayed in Grid mode
3. Ctrl + Shift + F :: Result will be saved to a File

No comments:

Post a Comment