D365 F&O -The permission 'KILL DATABASE CONNECTION' is not supported in this version of SQL Server. Alternatively, use the server level 'ALTER ANY CONNECTION' permission.

 Error message : Receive the following error while importing a bacpac to a Dev environment

Error SQL72014: Framework Microsoft SqlClient Data Provider: Msg 4630, Level 16, State 1, Line 1 The permission 'KILL DATABASE CONNECTION' is not supported in this version of SQL Server. Alternatively, use the server level 'ALTER ANY CONNECTION' permission.

Error SQL72045: Script execution error.  The executed script:

GRANT KILL DATABASE CONNECTION TO [ms_db_configreader];


Steps to resolve the issue:

Step 1: 

Rename the BACPAC file to .zip

Go to the folder where you have saved your BACPAC file and rename the BACPAC file with a .zip extension




Press "Yes" to convert the .bacpac file to zip file.

Step 2 : Open zip file ,  


Step 3: Copy the model.xml file into the different location

Step 4: O
pen it in notepad editor.






Step 5.  Delete the entire Element tag which contains " Grant.KillDatabaseConnection " 



 Step 6. After deletion of the element type mentioned in Step 5. it look like below.


Step 8: Download the latest SqlPackage file from the below link:

https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16



Step 7:  Rename the the file modelCopy.xml  and paste it in the SqlPackage folder.




Step 8: Rename the zipfile to bacpac file  (reverting back the changes from step 1)





Step 8: Login to command prompt as administrator. 

Step 9:  Navigate to the downloaded SQLPackage folder and run the below command.



SqlPackage.exe /a:import /sf:"C:\Users\Admin68bddd1058\Downloads\UAT\ImportDB.bacpac" /tsn:NAG-NEWDEV02-1 /tdn:AxDB /p:CommandTimeout=200000 /TargetEncryptConnection:False /mfp:"Model.xml"

This will resolve your issue of Importing the Bacpac file into D365 F&O Tier 1 environments

 

Comments

Popular posts from this blog

Customization on Sales invoice Report in D365 F&O

46) D365 FO: SHAREPOINT FILE UPLOAD USING X++

75) COC - Create a coc of the table modified method