可以在 SQL Server 2012 上还原 SQL Server 2014 的备份吗?
我知道您不能(至少不容易)在 SQL Server 2008 上恢复 SQL Server 2012 备份.但是它如何从 SQL Server 2014 到 SQL Server 2012 工作?
I know that you can't (at least not easily) restore a SQL Server 2012 backup on SQL Server 2008. But how does it work for SQL Server 2014 to SQL Server 2012 ?
在数据库级别,可以将兼容模式调整为任何其他 SQL Server 版本.
On database level there is the property to adjust the compatibility mode to any other SQL Server version.
这有什么帮助或作用?它只会禁止 2014 年的功能吗?
How does this helps or work ? Will it only disallow the features from 2014?
老实说,我已经尝试过恢复备份,但是 2012 无法识别数据文件,所以我无法单击 ok 按钮
开始恢复过程.
To be honest I already tried to restore a backup, but 2012 didn't recognize the datafile, so I couldn't click ok Button
to start the restore procedure.
我是否错过了一些重要的选项?
Did I miss some important option ?
推荐答案
您不能这样做 - 您不能从较新版本附加/分离或备份/恢复数据库> SQL Server 下降到旧版本 - 内部文件结构差异太大,无法支持向后兼容性.这在 SQL Server 2014 中仍然适用 - 您无法在另一个 2014 机器(或更新)以外的任何设备上恢复 2014 备份.
You CANNOT do this - you cannot attach/detach or backup/restore a database from a newer version of SQL Server down to an older version - the internal file structures are just too different to support backwards compatibility. This is still true in SQL Server 2014 - you cannot restore a 2014 backup on anything other than another 2014 box (or something newer).
你可以通过
在所有机器上使用相同版本的 SQL Server - 然后您可以轻松地在实例之间备份/恢复数据库
using the same version of SQL Server on all your machines - then you can easily backup/restore databases between instances
否则,您可以在 SQL Server Management Studio (Tasks >) 中为结构(表、视图、存储过程等)和内容(表中包含的实际数据)创建数据库脚本; 生成脚本
) 或使用第三方工具
otherwise you can create the database scripts for both structure (tables, view, stored procedures etc.) and for contents (the actual data contained in the tables) either in SQL Server Management Studio (Tasks > Generate Scripts
) or using a third-party tool
或者您可以使用第三方工具,例如 Red-Gate 的 SQL 比较 和 SQL 数据比较 在源和目标之间进行差异化",根据这些差异生成更新脚本,然后在目标平台上执行这些脚本;这适用于不同的 SQL Server 版本.
or you can use a third-party tool like Red-Gate's SQL Compare and SQL Data Compare to do "diffing" between your source and target, generate update scripts from those differences, and then execute those scripts on the target platform; this works across different SQL Server versions.
兼容模式设置仅控制您可以使用哪些 T-SQL 功能 - 这有助于防止意外使用其他服务器中不可用的新功能.但它确实不会改变.mdf
文件的内部文件格式——这不是解决该特定问题的方法——没有解决方案用于从较旧实例上较新版本的 SQL Server 恢复备份.
The compatibility mode setting just controls what T-SQL features are available to you - which can help to prevent accidentally using new features not available in other servers. But it does NOT change the internal file format for the .mdf
files - this is NOT a solution for that particular problem - there is no solution for restoring a backup from a newer version of SQL Server on an older instance.
相关文章