Sql server 无法将SQL Azure bacpac导入2016 CTP

Sql server 无法将SQL Azure bacpac导入2016 CTP,sql-server,azure-sql-database,sql-server-2016,Sql Server,Azure Sql Database,Sql Server 2016,我非常熟悉从Azure SQL V12导出到我的开发盒,然后导入到本地SQL 2014实例的过程。我正在开发一个新的Win10机器,并安装了SQL 2016 CTP。我正在连接到同一个Azure实例,可以对其进行操作,并且可以像2014年一样导出.bacpac 但当我尝试导入到本地时,我得到: Could not import package. Warning SQL72012: The object [FOO33_Data] exists in the target, but it will

我非常熟悉从Azure SQL V12导出到我的开发盒,然后导入到本地SQL 2014实例的过程。我正在开发一个新的Win10机器,并安装了SQL 2016 CTP。我正在连接到同一个Azure实例,可以对其进行操作,并且可以像2014年一样导出.bacpac

但当我尝试导入到本地时,我得到:

Could not import package.
Warning SQL72012: The object [FOO33_Data] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.
Warning SQL72012: The object [FOO33_Log] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.
Error SQL72014: .Net SqlClient Data Provider: Msg 547, Level 16, State 0, Line 3 The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_dbo.Address_dbo.User_idUser". The conflict occurred in database "FOO33", table "dbo.User", column 'idUser'.
Error SQL72045: Script execution error.  The executed script:
PRINT N'Checking constraint: FK_dbo.Address_dbo.User_idUser [dbo].[Address]';

ALTER TABLE [dbo].[Address] WITH CHECK CHECK CONSTRAINT [FK_dbo.Address_dbo.User_idUser];

因为这个问题也在MSDN上被问到和回答,我将在这里分享。

链接答案的文本:


我怀疑这里的问题在于,导出操作是使用在导出过程中发生变化的DB实例执行的。这可能会导致导出的表数据不一致,因为与SQL Server的物理备份/恢复不同,导出不能保证事务一致性。相反,它们基本上是通过依次连接到数据库中的每个表并运行select*来执行的。当两个表之间存在外键关系且读取的表数据不一致时,在将数据写入数据库且导入代码尝试重新启用外键后,将导致导入期间出错。我们建议使用数据库复制机制将数据库copyDb创建为originalDb的副本,以保证事务一致性,然后从不更改的数据库副本导出。

那又怎样?SQL Server 2016 CTP是一个CTP,其他产品不完全支持它吗?这里有什么奇怪的地方吗?它说的是错误SQL72014:.Net SqlClient数据提供程序:Msg 547,级别16,状态0,第3行ALTER TABLE语句与外键约束FK_dbo.Address_dbo.User_idUser冲突。数据库FOO33表dbo.User列“idUser”中发生冲突请尝试解析error@justSteve,我从生产到本地导入都遇到了相同的错误,您找到解决方案了吗?如果是,如果您提供有关如何解决此问题的最新信息,将非常有帮助。我见过少数情况下报告错误,但导入成功。也可以尝试重新运行op。避免只使用答案的链接进行回答。这是SO的一个主要原则。尝试过这个,但也不重要。