Wednesday, November 19, 2014

Unable to display this web part: The response from database contains more than '2000' rows.


While using SharePoint Business Data Connectivity App to query a SQL Database, I received: The response from database contains more than '2000' rows. The list would no longer populate, in its place, an ugly red error message.
After some readying, I discovered that means I have hit the default throttling limit set by SharePoint. I had the option of filtering your query to be more specific or to increase the limit to allow the large query to run. Here is a PowerShell script which is used to Increase the BDC Throttle Limit:

  1. Run PowerShell as administrator
  2. Get-SPServiceApplicationProxy
    1. This command will give you a list of all Service apps and their GUID. You want to copy the GUID for the BDC app you’re working with.
  3. Get-SPBusinessDataCatalogThrottleConfig -Scope Database -ThrottleType Items -ServiceApplicationProxy xxxxxxxxxxxxxxxxxxxxxx
    1. Where the xxxxxxxxxxxxxxxxxxxxxx are, replace with the GUID for the BDC app which you copied in step 2.
  4. The returned data will show you the current limitations – which should say ‘2000’ rows unless you’ve already increased this limit in the past.
  5. $Db = Get-SPBusinessDataCatalogThrottleConfig -Scope Database -ThrottleType Items -ServiceApplicationProxy xxxxxxxxxxxxxxxxxxxxxx
  6. Set-SPBusinessDataCatalogThrottleConfig -Identity $Db -maximum 20000 -default 20000
    1. Replace the xxxxxxxxxxxxxxxxxxxxxx with the BDC App GUID from step 2.
    2. Replace the ‘20000’ with a different number if you desire. This is going to be the new throttle limit.
  7. Refresh your SharePoint page and you should now see your content without the error!

No comments:

Post a Comment