Skip to content

Commit

Permalink
Use rendered description instead of raw description 🍡
Browse files Browse the repository at this point in the history
  • Loading branch information
blakedrumm authored May 8, 2024
1 parent bde9bf6 commit d2ad6a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SQL Queries/Data Warehouse/DW_Events_ByTotalEvents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
--
-- Author: Blake Drumm (blakedrumm@microsoft.com)
-- Date Created: May 7th, 2024
-- Date Modified: May 8th, 2024
-- Original query: https://kevinholman.com/2016/11/11/scom-sql-queries/#:~:text=Events%20Section%20(Warehouse)
----------------------------------------------------------------------------------------------------------------
-- Selects the top 100 records from the result set
SELECT TOP 100
evt.EventDisplayNumber, -- Display number of the event
evtd.RawDescription, -- Raw description of the event
evtd.RenderedDescription, -- Raw description of the event
evtlc.ComputerName, -- Name of the computer logging the event
COUNT(*) AS TotalEvents, -- Total number of events aggregated by display number, description, and computer name
DATEDIFF(DAY, MIN(evt.DateTime), MAX(evt.DateTime)) + 1 AS DaysOfData -- Calculates the span of days between the earliest and latest event dates for each group
Expand All @@ -30,7 +31,7 @@ INNER JOIN
ON evt.LoggingComputerRowId = evtlc.EventLoggingComputerRowId
GROUP BY
evt.EventDisplayNumber, -- Groups the results by event display number,
evtd.RawDescription, -- raw event description,
evtd.RenderedDescription, -- raw event description,
evtlc.ComputerName -- and computer name
ORDER BY
TotalEvents DESC -- Orders the results by the total number of events, in descending order

0 comments on commit d2ad6a3

Please sign in to comment.