SMS SQL for Joining Status Message and Attribute Views
Simple query joining status message and attribute views.
----Begin SQL----
SELECT SM.MachineName, SM.Component, SM.MessageID,
COUNT(*) AS 'Count', SMA.AttributeValue
FROM v_StatusMessage SM LEFT OUTER JOIN v_StatMsgAttributes SMA
ON SM.RecordID = SMA.RecordID
GROUP BY SM.Component, SM.MessageID, SM.MachineName, SMA.AttributeValue
ORDER BY SM.Component, SM.MessageID
----End SQL----
----Begin SQL----
SELECT SM.MachineName, SM.Component, SM.MessageID,
COUNT(*) AS 'Count', SMA.AttributeValue
FROM v_StatusMessage SM LEFT OUTER JOIN v_StatMsgAttributes SMA
ON SM.RecordID = SMA.RecordID
GROUP BY SM.Component, SM.MessageID, SM.MachineName, SMA.AttributeValue
ORDER BY SM.Component, SM.MessageID
----End SQL----
Comments