我正在创建一个包含名为 MonthName 的列的表。当我定义这个列时,“MonthName”这个词以蓝色显示,就像它是一个保留字一样。所以我试着查了一下。
我在联机丛书中或 Microsoft 的网站上,甚至在我们自己的 SO 上都找不到它。
我尝试了 sp_help "monthname",得到的回复是“对象 'monthname' 在数据库 'yourdb' 中不存在或对于此操作无效。
这是代码
Create Table AtlasDataWarehouseReports.Calendar
(
CalendarId Integer NOT NULL,
DateValue Date NOT NULL,
DayOfTheWeek Integer NOT NULL,
NameOfDay VarChar (10) NOT NULL,
MonthNumber Integer NOT NULL,
MonthName VarChar (10) NOT NULL,
CalendarQuarter Integer NOT NULL,
NameOfCalendarQuarter VarChar (20) NOT NULL,
FinancialQuarter Integer NOT NULL,
NameOfFinancialQuarter VarChar (20) NOT NULL,
CalendarYear Integer NOT NULL,
FinancialYear Integer NOT NULL,
WeekOfYear Integer NOT NULL,
JulianDay Integer NOT NULL,
USAIsBankHoliday Bit NOT NULL,
USADayName VarChar (100) NULL,
)
SQL Server 版本信息 Microsoft SQL Server 管理工作室 10.0.2531.0 Microsoft 分析服务客户端工具 10.0.1600.22 Microsoft 数据访问组件 (MDAC) 3.85.1132 微软 MSXML 2.6 3.0 4.0 5.0 6.0 微软 Internet Explorer 8.0.6001.18702 微软 .NET 框架 2.0.50727.3082 操作系统 5.1.2600
请问,SQL 2008 中的 MonthName 是什么?