T-SQL Tutorial

Time - TSQL Tutorial


On Transact SQL language the time is part of date and time data types and define a time of a day.

Time syntax:

time

PropertyValue
Default string literal formathh:mm:ss[.nnnnnnn]
Range00:00:00.0000000 - 23:59:59.9999999
Length8 minimum - 16 maximum
Storage size5 bytes

Time example:

USE model;
GO
DECLARE @time time = '08-21-14 10:21:12.123';
SELECT @time AS 'Time';
GO

Time
10:21:12.1230000