Time DataType in Sql Server 2005

后端 未结 3 709
别跟我提以往
别跟我提以往 2020-12-18 15:08

I\'ve created small database under SQL Server 2008. Now i wanted to move it to SQL Server 2005 and it doesn\'t work since it doesn\'t have Ti

3条回答
  •  心在旅途
    2020-12-18 15:44

    SQL Server 2005 does support the DATETIME datatype, which also includes time. To store only the time, you can use the CONVERT statement:

    SELECT CONVERT(DATETIME, '11:22:33')
    

    It's not optimal, because the date part is not used, but still takes up storage space. But then again, downgrading a database to a previous version never is optimal.

提交回复
热议问题