根据MSDN,Getdate(),GetUtcDate()和CURRENT_TIMESTAMP都返回DATETIME。我进行了简短测试,确认了:
CREATE TABLE #t(T DATETIME2(7));
GO
DECLARE @i INT ;
SET @i=1;
WHILE @i<10000 BEGIN ;
INSERT #t VALUES(CURRENT_TIMESTAMP) ;
SET @i=@i+1;
END ;
SELECT DISTINCT t
FROM #t
ORDER BY t ;
---
2013-01-28 13:23:19.4930000
2013-01-28 13:23:19.4970000
2013-01-28 13:23:19.5000000
2013-01-28 13:23:19.5030000
2013-01-28 13:23:19.5070000
2013-01-28 13:23:19.5100000
2013-01-28 13:23:19.5130000
(剪断)
是否有返回DATETIME2(7)的类似函数?
SYSUTCDATETIME()
补充GETUTCDATE()
。