Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Show millisecond value

$
0
0
Hi,I have the below SQL statement[code="sql"]select CONVERT(TIME, DATEADD(SECOND, DATEDIFF(SECOND, last_request_start_time, GETDATE()), 0), 114) AS Duration, * from sys.dm_exec_sessions where (status <> 'sleeping' or open_transaction_count > 0) order by last_request_end_time [/code]Duration session_id ...00:00:00.0000000 139 ...The duration if it is less than one second, it will always show 00:00:00.0000000. How can I show the MILLISECOND value like 00 00:00:00.050 ?Thanks,

Viewing all articles
Browse latest Browse all 3145

Trending Articles