How to set a DateTime variable in SQL Server 2008?

前端 未结 10 1893
暗喜
暗喜 2020-12-30 20:15

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.

Wh

10条回答
  •  再見小時候
    2020-12-30 21:14

    Try using Select instead of Print

    DECLARE @Test AS DATETIME 
    
    SET @Test = '2011-02-15'
    
    Select @Test
    

提交回复
热议问题