Formatting Text Field As HH:MM:SS

I am having to Cast() a Text datatype to a TIME datatype. THe issue I’m running into is when the results display i’m loosing the hh:mm:ss format. The syntax I am using is Select SUM(CAST(salestime As Time)) From testData; How do I display my query results in hh:mm:ss format? I also tried to use this syntax SUM(Cast(Time_Format(salesTime, "%h, %i, %s") As Time)) but that is returning a whole number

Go to Source
Author: jamesMandatory


I am attempting to add a query for monitor recent CPU usage for our SQL servers into an SSRS dashboard. I have encountered numerous examples online recommending querying the sys.dm_os_ring_buffers DMV, where the relevant CPU information can be extracted from the XML records where


However, none of our instances return any rows for this ring_buffer_type value. There is plenty of data within the DMV for other ring_buffer_type values including RING_BUFFER_SCHEDULER, but none for RING_BUFFER_SCHEDULER_MONITOR.

To clarify, if I run hte following query :

SELECT *FROM sys.dm_os_ring_buffers

then it always comes up empty.

I am wondering if something needs to be enabled at the server or DB level to allow the recording of this data but have been unable to locate this information. Any help would be appreciated. All of our instances are on SQL Server 2016

Go to Source
Author: Blimbeard