locked
SQL error when selecting contracts tile in CRM 2013 RRS feed

  • Question

  • Hi,

    We've just upgraded from CRM 2011 to 2013. When we select Sales > Accounts > Contracts we get a SQL error. Everything else seems to have upgraded  fine. It gives very little detail, any suggestions on trouble shooting appreciated.

    SQL Server Error

    A SQL Server error occurred. 

    Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.

    Regards

    Will

    Friday, November 1, 2013 10:50 AM

All replies

  • You can turn SQL Server Profiler to findout what is that SQL Server error exactly. Check in another environment and see if it happens there also.
    Friday, November 8, 2013 8:35 PM
  • We are getting the same error after upgrading from CRM 2011 to 2013. Running the SQL profiler is showing an invalid query constructed by CRM when opening a contract. The invalid queries are

    create table #RollupIds(RollupId uniqueidentifier PRIMARY KEY CLUSTERED)
    create statistics rupstat on #RollupIds(RollupId)
    select
     DISTINCT  top 251 "contract0".Title as "title"
    , "contract0".StateCode as "statecode"
    , "contract0".ActiveOn as "activeon"
    , "contract0".ExpiresOn as "expireson"
    , "contract0".ContractId as "contractid"
    from
     ContractBase as "contract0" (NOLOCK) 
    where
     (("contract0".ContractId in (select contract0.ContractId from Contract as contract0 WITH (NOLOCK) where exists (select RollupId from #RollupIds where RollupId = contract0.CustomerId)select contract0.ContractId from Contract as contract0 WITH (NOLOCK) where exists (select RollupId from #RollupIds where RollupId = contract0.BillingCustomerId)))) order by
     "contract0".Title asc
    , "contract0".ContractId asc

    the bolded select  is invalid as it is missing an "and exists". This error seems to be a bug in CRM 2013. I would appreciate if anyone has found a workaround or a solution to this issue.

    Carlos

    Tuesday, November 12, 2013 7:07 PM
  • We are having the exact same problem. We've opened a support request and this is a known issue, the problem is, not enough people have reported it so this is handled with low priority. We were provided with a workaround because of this.

    So all of you that are facing this problem, please open a support request regarding this, and then this may get actually solved.

    Thursday, December 5, 2013 10:10 AM