I upgraded my CRM 2011 database to CRM 2013. Now when I try to open the Associated Contracts from an Account I get: A SQL Server error occurred.
I ran the SQL Profiler and get the following exception error:
Incorrect syntax near the keyword 'select'.
Incorrect syntax near ')'.
Incorrect syntax near ')'.
This is the statement that is failing:
select
DISTINCT top 51 "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
I believe this is Standard CRM and no customizations. Can someone please give me a fix or work around?