VSTS 2008 Database Edition doesn't seem to know 'DATEADD' constants, any ideas?
Posted
by Marcel Marchon
on Stack Overflow
See other posts from Stack Overflow
or by Marcel Marchon
Published on 2009-12-30T16:50:15Z
Indexed on
2010/03/28
3:03 UTC
Read the original article
Hit count: 324
vsts2008
I'm trying to implement a database build using VSTS 2008 Database Edition. The build always fails on the following constraint:
ALTER TABLE [dbo].[tablename]
ADD CONSTRAINT [DF_tablename_date] DEFAULT (CONVERT([varchar],dateadd(hour,(-1),getdate()),(1))) FOR [date];
The error that it shows is the following:
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.
Anybody have an idea what is wrong here?
© Stack Overflow or respective owner