SQL Server 2008 is not doing what I expected with DateTime. It doesn\'t let me set DateTime variables, no matter what date format I use.
DateTime
Wh
You need to enclose the date time value in quotes:
DECLARE @Test AS DATETIME SET @Test = '2011-02-15' PRINT @Test