Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Generic SQL error while Assigning or Sharing a record

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 CRM version 2016 (8.2), On Premise.

While sharing/assigning a record in CRM we are getting Generic SQL error.

from the MicrosoftDynamicsCRM\Trace, we find out the exception as below.

>Crm Exception: Message: Generic SQL error., ErrorCode: -2147204784, InnerException: System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'r'.
Invalid column name 's'.
An explicit value for the identity column in table '#CascadeCollect' can only be specified when a column list is used and IDENTITY_INSERT is ON.

Please suggest on this.

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Generic SQL error while Assigning or Sharing a record

    For anyone with a similar issue, here's what I found and eventually did to resolve.

    We ran SQL traces to capture the actual error on the SQL side. It appeared that our list of functions (core CRM deployed functions) were different from the functions in the same Organisation in our UAT environment, meaning that the databases were on different versions of CRM.

    Our problem was caused because we initially have CRM 2013 SP1 Update Rollup 5 installed and we regressed this update, taking the server back to CRM 2013 SP 1.

    For some reason our organisation database seemed to be stuck on an older version, so we;

    1. Disabled and deleted Organisation in deployment manager

    2. Installed CRM 2013 SP1 Update Rollup 5 again onto our server

    3. Imported the organisation again...this step is important as it updates the SQL database with any objects applicable to the current rollup version.

    4. This brought all the core CRM SQL objects in the database in line with the CRM version installed.

  • Community Member Profile Picture
    on at
    RE: Generic SQL error while Assigning or Sharing a record

    Hi there bnsp

    Did you manage to resolve your issue.

    We have same occurring on CRM 2013 SP 1. Also cannot assign across all entities. This is just in our production environment.

    Same error with invalid column name 'r', 's'

    UAT and Dev are working fine.

    Thx,

    Neil

  • Community Member Profile Picture
    on at
    RE: Generic SQL error while Assigning or Sharing a record

    Hi Radu,

    it's happening for all entities.

    and it's working fine for the same solution (XXX_MSCRM) in different environment

    Thanks,

    bnsp

  • Radu Chiribelea Profile Picture
    6,667 on at
    RE: Generic SQL error while Assigning or Sharing a record

    Hi bnsp,

    Does this happen for all entities (accounts, contacts, opportunities, custom entities, etc.) or only some?

    Where there any modifications made to the stored procedures or the CRM Database?

    Regards,

    Radu

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans