Generic SQL Error – RetriveMultiple with ConditionOperator.Contains in CRM


Hi,

Was getting Generic SQL Error while using ConditionOperator.Contains in the ConditionExpression. The requirement was to get all the incident records based on the title attribute value.

condExp.AttributeName = “title”;

condExp.Operator = ConditionOperator.Contains;

condExp.Values.Add(“test”);

The correct way to perform this kind of search is by using Like operator with %.

condExp.AttributeName = “title”;

condExp.Operator = ConditionOperator.Contains;

condExp.Values.Add(“%test%”);

http://social.microsoft.com/Forums/en-US/ede5932b-5ac9-4fc9-86d9-12ef5b2b305d/crm-2011-getting-generic-sql-error-when-performing-retrievemultiple-with?forum=crmdevelopment

Hope it helps.