CRM 4.0 – Exporting to Excel over 10000 rows

en-US113_Office_Excel_2010_065-06962[1]The power of exporting to Excel is one of CRM’s greatest functionalities. Often people bump their head against and internal limit of 10,000 rows set by the dev team to ensure you don’t receive a timeout error as SQL churns through the export process.

How to solve the problem

To change this in CRM 4.0:

1. Log-in to the SQL Server where the <Organization_Name>_MSCRM database is stored.
2. Open the OrganizationBase table.
3. Find the Column:  MaxRecordsForExportToExcel.
4. Change the value from 10,000 to the desired value.
5. Commit the change to the database.

Additional Notes

IISReset

In order for CRM to respond to the changes you will need to perform an IISReset to restart the CRM website. You may only need to reset the Application Pool for your CRM instance if you are hosting multiple websites. You can also run the following script from the command line to reset the AppPool –

cscript iisapp.vbs /a CrmAppPool /r

SQL Timeout

You may receive an SQL error indicating SQL has timed out processing your request.

The SQL timeout is controlled by a registry value on each CRM server:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\OLEDBTimeout

This value does not exist by default. If it does not exist then the default value will be 30 seconds. To change it add the registry value (of type DWORD) and set the value you want measured in seconds. If you set the value to 0 (Zero) SQL Server will not timeout. This is not recommended. Remember to use IISreset or iisapp.vbs to reset the CRM application pool in order for the changes to take effect.

Conclusion

This is a summary of a number of other posts and follow on questions. It was my hope to create a comprehensive overview of some of the issues which might occur when trying to export more than 10,000 records from CRM to Excel.

 

Jeff Loucks
Available Technology
Available Technology

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>