文章目录
- 前言
- 解决步骤
-
- 1.将BACPAC文件重命名为.zip
- 2.打开压缩包,将model.xml文件复制到外面位置
- 3.打开编辑model.xml文件
- [4.删除包含"Grant.KillDatabaseConnection "的整个元素标签](#4.删除包含“Grant.KillDatabaseConnection ”的整个元素标签)
- 5.文件扩展名从.zip改回为.bacpac
- 6.添加新参数,重新执行命令
- 参考链接
前言
在将 bacpac 导入开发环境时,收到以下错误:
Error importing database:Could not import package.
Error SQL72014: Core 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_uno_dev_writer];
解决步骤
1.将BACPAC文件重命名为.zip
2.打开压缩包,将model.xml文件复制到外面位置
3.打开编辑model.xml文件
4.删除包含"Grant.KillDatabaseConnection "的整个元素标签
5.文件扩展名从.zip改回为.bacpac
6.添加新参数,重新执行命令
SqlPackage.exe /a:import /sf:C:\HS\AXDB.bacpac /tsn:localhost /tdn:AxDB_New /p:CommandTimeout=2400 /mfp:C:\model.xml
参数描述:
/sf:把你的 .bacpac 包文件路径放在这里。
/mfp:覆盖源文件中的修改后model.xml model.xml。