我正在尝试使用 VSTS 2008 Database Edition 实现数据库构建。构建总是在以下约束下失败:
ALTER TABLE [dbo].[tablename]
ADD CONSTRAINT [DF_tablename_date] DEFAULT (CONVERT([varchar],dateadd(hour,(-1),getdate()),(1))) FOR [date];
它显示的错误如下:
TSD03082: The name "hour" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
有人知道这里有什么问题吗?