我已在 bacpac 文件中对 SQL Azure 进行了备份,当我尝试将 bacpac 导入 localdb 时,它总是失败。
这是我使用的命令:
PS C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin> .\SqlPackage.exe /Action:Import
/SourceFile:"C:\Users\S\Desktop\MyDb.bacpac"
/TargetConnectionString:"Data Source=(localdb)\v11.0;Initial Catalog=MyDb; Integrated Security=true;"
Run Code Online (Sandbox Code Playgroud)
这是错误消息:
*** Error importing database:Data cannot be imported into target because it
contains one or more user objects. Import should be performed against a new, empty
database.
Error SQL0: Data cannot be imported into target because it contains one or more
user objects. Import should be performed against a new, empty database.
Run Code Online (Sandbox Code Playgroud)
我的机器是新装的,根本没用过localdb。