web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Import error - SQL Duplicate constraint error

(0) ShareShare
ReportReport
Posted on by
I have encountered a problem importing a solution. The solution is one of ours, so we know what is in it. Importing it into a new organisation on the same server (CRM 365 On Premise v8.2.2.112) and the import fails. I have found the problem, and it does seem to be a bug in dynamics. I'm just not sure where to report it or whether there is a patch available that resolves it. When the import fails dynamics doesn't give any indication why. So I've had to turn on logging to find the cause. The significant bit in the logs is: >Exception when executing non-query: CREATE TABLE dbo.[active_safeandwellactivityBase] ([ActivityId] uniqueidentifier NOT NULL , ..., [active_staffcount_State] int NULL CONSTRAINT [DF_ActivityPointerBase_active_staffcount_State] DEFAULT 0, ... ) Exception: System.Data.SqlClient.SqlException (0x80131904): There is already an object named 'DF_ActivityPointerBase_active_staffcount_State' in the database. I have omitted most of the fields for brevity. Key thing to note is the SQL error: There is already an object named 'DF_ActivityPointerBase_active_staffcount_State' in the database. Looking in the backend database behind the source solution the constraint is called: DF_active_safeandwellactivityBase_active_staffcount not DF_ActivityPointerBase_active_staffcount_State So my conclusion is that on import Dynamics isn't using the correct table/entity name when generating the name for the constraint. The two other key parts to this puzzle are: 1. This is a rollup field. 2. There is one other entity in the solution that also has a field with the same name that is also a rollup field. Our work-around has been to delete one of the fields, and recreate it with a new (globally unique) name, and this allows us to import. Of course we shouldn't need to do this. Is this a known bug? Anyone know when a published fix for it likely to be available?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi Brian Cryer,

    I do not think this is a common bug, but it sounds like you have found a good workaround that allows you to import the solution.

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Hi,

    Have not encountered this, but are you able to replicate this in another environment?

    If you moved this in your solution from dev to test and production, does it happen in both test and production?

    You might want to see if there are update to On Premise 8.2.2.112 that might solve this issue.

    We had to update our 112 with a hotfix a while back to resolve some other issues that we had.

    Hope this helps.

  • Community Member Profile Picture
    on at

    HI Aric.

    Yes it happens in both test and production. First found it when trying to deploy to production. Then discovered it also happened in test and that's when I started digging. My work around works. I'm just a little disappointed that I can't find anywhere to report this bug to the dev team. (I only have limited support calls and don't want to squander one of those just to tell them about a bug that I can already work around.)

    Your suggestion of hotfixes is a good one, but I'm not sure that Microsoft publish a list of those - or am I wrong? do you know where I can see if anything is available?

    Thank you.

  • Community Member Profile Picture
    on at

    Hi Brian,

    Interesting to know.

    BTW, you may ask Dynamics Support not to decrement the support call from your subscription if its confirmed as a bug. But it requires some time investment to convince.

    Or you may add this on Dynamics Ideas where we may post ideas, suggestions, bugs, enhancements, etc.

    experience.dynamics.com/ideas

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans