Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

SQL error when selecting contracts in CRM 2013

$
0
0

We upgraded from CRM 2011 to 2013, and when we select Sales > Accounts > Contracts we get a SQL error:

SQL Server Error

A SQL Server error occurred

Running the SQL profiler shows an invalid query being constructed by CRM when opening the contract. The queries sent to SQL Server 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 query has an invalid "select" in the query and it seems to be missing an "and exists (select". The error appearsto be a bug in CRM 2013. I would appreciate any help to resolve the issue or a workaround.

Carlos


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>