简体   繁体   English

SQL Server 2008与SQL Server 2005的兼容性

[英]SQL Server 2008 compatibility with SQL Server 2005

使用SQL Server 2008作为开发数据库的最佳方法是什么,但确保数据库与SQL Server 2005兼容?

This can be done via SQL Enterprise Manager or like this: 这可以通过SQL企业管理器完成,或者像这样:

ALTER DATABASE <database> 
SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }

Use 90 for 2005 compatibility. 使用90表示2005兼容性。

This replaces the functionality used for previous releases, the stored procedure sp_dbcmptlevel . 这取代了以前版本使用的功能,即存储过程sp_dbcmptlevel

You can set the database compatibility level, but there is no guarantee that this will cover all your bases. 您可以设置数据库兼容级别,但不保证这将涵盖您的所有基础。 For example the new data types will be available on the SQL 2008 system, but they won't be available on the SQL 2005 server. 例如,新的数据类型将在SQL 2008系统上可用,但它们在SQL 2005服务器上不可用。

The only way to guarantee that everything will work from Dev to Prod is to put SQL 2005 in development. 确保从Dev到Prod的所有工作都能正常工作的唯一方法就是将SQL 2005用于开发。

Don't forget that there are also behavioral differences between the two versions, and something on 2008 may perform differently (and insufficiently) than 2005 all other things equal - this will obviously depend on a lot of factors about your data and application. 不要忘记,两个版本之间也存在行为差异,2008年的某些内容可能与2005年的其他内容相同(并且不充分) - 这显然取决于您的数据和应用程序的很多因素。

You're better off developing against the lowest common denominator and testing against the newer versions. 你最好针对最低的公分母进行开发,并针对新版本进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM