MR error ‘Sequence contains no elements’ after applying CU13

After upgrading to MR 2012 CU13, you may encounter the following error on the CompanyProvider to Company task:

Sequence contains no elements.

 

This error will occur if there is a missing record in the Reporting.ControlCompanyIntegration table, in the Management Reporter database. To correct this, you’ll need to run the following queries:

select * from Reporting.ControlCompany

 

select * from Reporting.ControlCompanyIntegration

 

There should be an equal number of records in both tables. The exception is if you have Legacy companies. Legacy companies will be in the Reporting.ControlCompany table only. If there is a record in the Reporting.ControlCompany but not the Reporting.ControlCompanyIntegration, you’ll need to make a backup of your database and then run the statement below.

 

MERGE Reporting.ControlCompanyIntegration AS TARGET

USING Reporting.ControlCompany AS SOURCE ON (TARGET.ID = SOURCE.ID)

WHEN NOT MATCHED BY TARGET AND GLEntityID not in (‘5F878A3C-5F4C-4806-B786-5CAB52C98F0F’)

–Update the “1” as needed based on value in Reporting.ControlIntegrationSource

THEN INSERT (ID, SourceID) VALUES (SOURCE.ID, 1); 

 

 

 A permanent fix is scheduled in an upcoming release.

 

Notice:

“Microsoft provides programming examples for illustration only, without warranty expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This mail message assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures.”

This is not an officially tested solution by Microsoft and should be fully tested before implementation.