SQL Server 兼容模式

发布于 2024-07-05 12:54:01 字数 169 浏览 9 评论 0原文

我们当前正在兼容模式 8 上运行服务器,我想更新它。

  • 仅仅进入并改变它会产生什么影响?
  • 什么可能会损坏?
  • 在我执行之前,是否有任何方法可以检查数据是否会保留?
  • 我可以回滚到模式 8 而不执行恢复且不会丢失数据吗?

We're currently running a server on Compatibility mode 8 and I want to update it.

  • What are the implications of just going in and changing it?
  • What is likely to break?
  • Is there anything that checks the data will survive before I perform it?
  • Can I rollback to mode 8 without performing a restore and without loss of data?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

一城柳絮吹成雪 2024-07-12 12:54:01

如果你从 80 到 90,差异很小。 从 65 到 70+ 可能会造成严重影响(NULL 的存储方式不同)。

影响 - 您的 SP 可能会返回与您预期不同的结果
可能损坏:功能、SP
数据应该保存下来; 里面没有任何东西应该影响事情。
从 80 移动到 90 并返回只需几秒钟。 是的,您可以来回移动。

http://msdn.microsoft.com/en-us/library/bb510680.aspx

一些问题:http://mapamdug。 blogspot.com/2006/03/sql-server-2005-gotcha-1.html

If you're going from 80 to 90, the differences are minimal. Going from 65 to 70+ can cause severe impact (NULLs are stored differently).

Implications - your SPs can return different results than you'd expect
Likely to break: functions, SPs
Data should survive; nothing in there should affect things.
Moving from 80 to 90 and back only takes a few seconds. Yes, you can move back and forth.

http://msdn.microsoft.com/en-us/library/bb510680.aspx

some gotchas: http://mapamdug.blogspot.com/2006/03/sql-server-2005-gotcha-1.html

述情 2024-07-12 12:54:01
  1. 兼容模式不影响存储。 这只是一面旗帜。 数据或查询不会发生任何变化。 只有查询执行会受到影响。
  2. 什么都没有——或者很多东西。 您是否使用了 2000 年标记为过时且可能被删除的语法? 您在查询中提供提示时是否使用了括号? 您是否使用了查询执行提示? 如果是,最好先修改数据库,删除过时的语法,放回括号并挖掘 BOL 来查找哪些提示会减慢新引擎上的微调查询速度。
  3. 不会。但数据会保留下来。 事实上,如果您能够在 server2005 上运行数据库,即使在模式 8 下,您也已经在使用新的数据格式了。
  4. 是的,您可以回滚。 它不是转换,它只是设置一个标志,上面写着“我的查询是兼容的”。
  1. Compatibility mode does not affect storage. It's just a flag. Nothing will change in the data or queries. Only query execution will get affected.
  2. Nothing - or lots of things. Did you use syntax marked as obsolete and subject to deletion in 2000? Did you use parethesis when providing hints in queries? Did you use query execution hints? If yes, it's better to revise your database first, remove obsolete syntax, put the parenthesis back and dig the BOL to find which hints are going to slow down your fine-tuned query on new engine.
  3. No. But the data will survive. In fact, if you are able to run your database on server2005, even in mode 8, you're using new data format already.
  4. Yes, you can roll back. It's not transforming, it's just setting a flag which says "My queries are that compatible."
泪之魂 2024-07-12 12:54:01

兼容模式禁用了新版本的功能,就我个人而言,我并没有真正使用过许多有问题的数据库,我们环境中的关键问题是迁移到 9 后,您无法再使用企业管理器来查看数据库。

备份/恢复是一个不错的选择,我也相信您可以毫无问题地将其翻转回来。

Compatibility mode disables the features of the newer version, personally I haven't really worked with many databases that have issues, the key thing that was a problem in our environment is after moving to 9, you can no longer use Enterprise Manager to view the database.

A backup/restore is a good option, and I also believe you can flip it back without any issues.

羞稚 2024-07-12 12:54:01

(我确实说过,只有当您从 6.5 开始迁移时,当 NULL - 70 及更高版本使用整个字段时,char() 字段中不存储任何内容,这可能会导致巨大的大小变化。)

VBStreets 的观点是正确的 - 并且绝对是在第 3 点上 - 当您在 2005 年第一次运行数据库时,它转换了数据结构。 如果您进行备份,则无论兼容性级别如何,都无法将其恢复到以前的版本。

(I did say it was only if you were moving from 6.5, which stored nothing in char() fields when NULL - 70 and greater use the whole of the field, which can cause massive size changes.)

VBStreets is right on his points - and definitely on point 3 - when you first ran the database on 2005 it converted the data structure. If you take a backup, it cannot be restored on prior versions, regardless of the compatibility level.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文