Hi,
I was trying to import the UAT Database to DEV, while Importing an unexpected error as occurred i.e., *** An unexpected failure occurred: Data plan execution failed with message One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Violation of PRIMARY KEY constraint 'PK__CLASSIDT__D9C1FA01463E3A33'. Cannot insert duplicate key in object 'dbo.CLASSIDTABLE'. The duplicate key value is (AADAuthenticationMonitoringAndDiagnostics).The statement has been terminated.))). Needed a solution to this problem.
Quick response is appreciated, Thanks in advance.
please confirm the following steps are performed
learn.microsoft.com/.../dbmovement-scenario-exportuat
Hi MuthuKumaranAX,
Thank you for the response,
Yes, All the steps are performed upto importing the database through executing a code in command prompt i.e., SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200
While this was processing it came across the error saying (*** An unexpected failure occurred: Data plan execution failed with message One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Violation of PRIMARY KEY constraint 'PK__CLASSIDT__D9C1FA01463E3A33'. Cannot insert duplicate key in object 'dbo.CLASSIDTABLE'. The duplicate key value is (AADAuthenticationMonitoringAndDiagnostics).
The statement has been terminated.))). )
Please find the below image of command prompt shows where the error has exactly occured.
Instead of restoring to existing AXDB Database. please try the following approach
1. stop the services
2. Rename AXDB to "AXDb_Old"
3. create new database and name it as AXDb
4. then import the database
Hi D365 User ,
I am also facing he exact same issue. Were you able to import successfully ? If Yes, Could you please provide the steps you followed(after you encountered this error). Also, if there were any services needed to be stopped or any other things to be done.
Your help will be much appreciated.
Thanks and Regards.
Hi, This error is suggesting that Database is trying to import duplicate record in ClassIdTable table.
I can see a record exist with Name AADAuthenticationMonitoringAndDiagnostics in ClassIdTable table.
To replicate this issue, I tried to import record with same name in this table and sql gave same error. You can check if for any reason there is duplicate records with Name AADAuthenticationMonitoringAndDiagnostics in UAT (source) database.
If not then take a backup of Dev (Target) Database, delete all records from this table and try to import the database.
Hello
You might want to check this thread
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 2,188
André Arnaud de Cal... 868 Super User 2025 Season 2
Sohaib Cheema 593 User Group Leader