The IN_DB_UTIL_FN_GET_DURATION function will calculate and print the elapsed duration of time based on the provided number of milliseconds.
Parameter | Description | |
---|---|---|
ELAPSED_MS | Type: | INPUT |
Datatype: | BIGINT | |
Default Value: | NULL | |
Description | Number of rows to use for calculating the RPM. | |
ELAPSED_MSG | Type: | OUTPUT |
Datatype: | NVARCHAR(128) | |
Default Value: | NULL | |
Description | The calculated rows per minute based on the provided number of rows and milliseconds. |
Usage
SELECT IN_DB_UTIL_FN_GET_DURATION(<MILLISECONDS>);
Example 1
SELECT inuser.IN_GET_DURATION(123456789) as [Total Duration];
Output to the Results Tab
Total Duration 1 Day 10 Hours 17 Minutes 36 Seconds 789 Milliseconds
Example 2
SET NOCOUNT ON; DECLARE @DURATION_MS BIGINT = 123456789, @DURATION NVARCHAR(128); BEGIN SELECT @DURATION = inuser.IN_GET_DURATION(@DURATION_MS); PRINT 'Total Duration is '+@DURATION; END;