Segue abaixo um problema que não tinha passado no SQL 2008 mais que muitos podem vir a passar:
Em muitos sistemas que já vi as somas ou subtrações são feitas como este exemplo abaixo:
DECLARE @DATE as DATETIME = GETDATE()
SELECT @DATE - 1 ----------------------- 2011-09-21 14:28:33.910
Porém no SQL2008 com os novos tipos de datas isso não funciona mais
DECLARE @DATE as DATETIME2(0) = SYSDATETIME() SELECT @DATE - 1 GO DECLARE @DATE as DATE = SYSDATETIME() SELECT @DATE - 1 Msg 206, Level 16, State 2, Line 4 Operand type clash: datetime2 is incompatible with int Msg 206, Level 16, State 2, Line 3 Operand type clash: date is incompatible with int
#FICA_A_DICA
Xupinhado de: http://sqlblog.com/blogs/aaron_bertrand/archive/2011/09/20/bad-habits-to-kick-using-shorthand-with-date-time-operations.aspx