且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用T-SQL获取datetime的时间?

更新时间:2023-02-05 20:31:06

只是为了从SQL Server 2008中添加一个TIME数据类型,从那时起,您可以执行以下操作: p>

Just to add that from SQL Server 2008, there is a TIME datatype so from then on you can do:

SELECT CONVERT(TIME, GETDATE())

对于那些使用SQL 2008+的用户而言,可能会遇到这个问题。

Might be useful for those that use SQL 2008+ and find this question.