• Nice query!! But the server start time is not coming out correct as you are subtracting all the days, and then all the hours and all the minutes. Just subtracting the total minutes of uptime from the current time should show the right date and time the server was last started.

    WITH ServerUpTimeInfo AS (

    SELECT (dm_io_virtual_file_stats.sample_ms / 1000.00 ) / 60.00

    AS server_up_time_min,

    ((dm_io_virtual_file_stats.sample_ms / 1000.00 ) / 60.00) / 60.00

    AS server_up_time_hr,

    (((dm_io_virtual_file_stats.sample_ms / 1000.00 ) / 60.00) / 60.00) / 24.00

    AS server_up_time_day

    FROM sys.dm_io_virtual_file_stats(1,1) AS dm_io_virtual_file_stats )

    SELECT CAST(server_up_time_min AS decimal(12,2)) AS server_up_time_min,

    CAST(server_up_time_hr AS decimal(12,2)) AS server_up_time_hr,

    CAST(server_up_time_day AS decimal(12,2)) AS server_up_time_day,

    CAST(DATEADD(mi,

    -ROUND(server_up_time_min, -1), getutcdate()) as smalldatetime

    ) as approx_server_start_utc_datetime

    FROM ServerUpTimeInfo;