Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

SQL Error if User is in more than 20 Teams

Posted on by 5

Hello,

we have one Problem in our CRM System. When a User is Member in more than 20 Teams he get a Generic SQL Error Message.

User in 20 Groups -> No Problem. User in 21 Groups -> SQL Error.

In the Trace we found this:

>Crm Exception: Message: Generic SQL error., ErrorCode: -2147204784, InnerException: System.Data.SqlClient.SqlException (0x80131904): Die Unterabfrage hat mehr als einen Wert zurückgegeben. Das ist nicht zulässig, wenn die Unterabfrage auf =, !=, <, <=, > oder >= folgt oder als Ausdruck verwendet wird.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
   at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
   at System.Data.SqlClient.SqlDataReader.Read()
   at Microsoft.Crm.CrmDataReader.Read()
   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.FillEntityCollectionFromDataReader(BusinessEntityCollection entities, IDataReader reader, EntityExpression entityExp, Boolean useEntityExpression, String aggregateLimitExceededName, Boolean quickFindRecordLimitCheckRequired, ExecutionContext context)
   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.QueryAndFillEntityCollection(CrmDbConnection dbConnection, IDbCommand dbCommand, BusinessEntityCollection entities, EntityExpression entityExp, PagingHelper pagingHelper, Boolean useEntityExpression, String aggregateLimitExceededName, ExecutionContext context)
   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, DatabaseQueryTarget queryTarget, PagingHelper pagingHelper, ExecutionContext context, Boolean needToSetRowVersion, Boolean isVersionNumberRequestedInRetrieve)
   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, DatabaseQueryTarget queryTarget, ExecutionContext context, Boolean needToSetRowVersion, Boolean isVersionNumberRequestedInRetrieve)
   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, DatabaseQueryTarget queryTarget, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.UserQueryServiceInternal`1.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context)
ClientConnectionId:75f3e2c7-d003-417d-b7f0-cc2348811fdf
Error Number:512,State:1,Class:16A4B7E148-3011-4164-AAA8-D5BEF55C6C76
The Problem is here because it gets more than 1 Result:

SELECT id from System.Collections.Generic.List`1[Microsoft.SqlServer.Server.SqlDataRecord])

The subquery has returned more than one value. This is not allowed if the subquery follows =, !=, <, <=, > or >= or is used as an expression.

and it refers to:
where POA.PrincipalId in ('34823431-06d6-e911-a81d-000d3a47fa69',(SELECT id from System.Collections.Generic.List`1[Microsoft.SqlServer.Server.SqlDataRecord])) and POA.ObjectTypeCode = 4230 and ((POA.AccessRightsMask|POA.InheritedAccessRightsMask) & 1) = 1)


Does anyone one what is the Problem here? We cant find out yet and think this is a Bug.

Kind regards,
David
  • DeeKay2107 Profile Picture
    DeeKay2107 5 on at
    RE: SQL Error if User is in more than 20 Teams

    Hello Andrew,

    thank you for your assessment. We contacted our sales partner to get a direct microsoft support for this problem.

    Kind regards,

    David

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: SQL Error if User is in more than 20 Teams

    Hello David,

    That looks like a bug for me and I would recommend getting in touch with Microsoft and opening a support ticket.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans