问题描述
我知道在您的原生数据库之前将数据库设置为 COMPATIBILITY_LEVEL 会阻止使用功能.然而,情况似乎并非如此.见证以下 SQL 脚本:
I understood that setting a database to a COMPATIBILITY_LEVEL prior to your native one prevented features from being used. However this doesn't seem to be the case. Witness the following SQL script:
CREATE DATABASE Foo
GO
USE Foo
GO
ALTER DATABASE Foo SET COMPATIBILITY_LEVEL = 80
GO
CREATE TABLE Bar
(
Id UNIQUEIDENTIFIER NOT NULL,
TestNvcMax NVARCHAR (MAX) NOT NULL, -- Arrived in SQL 2005
TestDateTime2 DATETIME2 (7) NOT NULL -- Arrived in SQL 2008
)
GO
但是这张桌子创造的很完美——有什么想法吗?我会认为某种错误消息或警告是合适的
But this table creates perfectly - any ideas? I would have thought some kind of an error message or warning would have been appropriate
推荐答案
在这里您可以阅读兼容性级别 80、90 和 100 之间的差异.更改数据库兼容级别
Here you can read about the differences between compatibility level 80, 90 and 100. ALTER DATABASE Compatibility Level
显然新数据类型不受影响.我认为兼容性级别是为了让 SQL Server 像旧版本一样表现",而不是阻止你做新的花哨的东西.
Apparently new data types is not affected. I think that compatibility level is there to make SQL Server "behave" like the older version, not prevent you from doing new fancy stuff.
这篇关于了解 SQL Server 中的 COMPATIBILITY_LEVEL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)