Has anyone ever done any SQL queries to gather status messages?  Any ideas on 
how I can get this data?

I can get just about any columns I need, but not the actual message itself!

My query
select top 1000 *
from v_statusmessage MSG INNER JOIN
     v_statmsgattributes ATT ON MSG.RecordID = ATT.RecordID INNER JOIN
       v_StatMsgInsStrings INS ON MSG.RecordID = INS.RecordID INNER JOIN
       v_StatMsgWithInsStrings WINS ON MSG.RecordID = WINS.RecordID

If I look at the canned report All messages for a specific message ID in SSRS, 
they are using an expression to populate the column, that's pulling all kinds 
of strings in?

SSRS expression
=SrsResources.Localization.GetStatusMessage(Fields!MessageID.Value, 
Fields!Severity.Value, Fields!MsgDLLName.Value,  User!Language, 
Fields!InsString1.Value, Fields!InsString2.Value, Fields!InsString3.Value, 
Fields!InsString4.Value, Fields!InsString5.Value, Fields!InsString6.Value, 
Fields!InsString7.Value, Fields!InsString8.Value, Fields!InsString9.Value, 
Fields!InsString10.Value)

Canned SQL Query
select top 1000 smsgs.RecordID,
        CASE smsgs.Severity
            WHEN -1073741824 THEN 'Error'
            WHEN 1073741824 THEN 'Informational'
            WHEN -2147483648 THEN 'Warning'
            ELSE 'Unknown'
         END As 'SeverityName',
        smsgs.MessageID, smsgs.Severity, modNames.MsgDLLName, smsgs.Component, 
smsgs.MachineName, smsgs.Time, smsgs.SiteCode, smwis.InsString1, 
smwis.InsString2, smwis.InsString3, smwis.InsString4, smwis.InsString5, 
smwis.InsString6, smwis.InsString7, smwis.InsString8, smwis.InsString9, 
smwis.InsString10
from fn_rbac_StatusMessage(@UserSIDs)  smsgs
join fn_rbac_StatMsgWithInsStrings(@UserSIDs)  smwis on smsgs.RecordID = 
smwis.RecordID
join fn_rbac_StatMsgModuleNames(@UserSIDs)  modNames on smsgs.ModuleName = 
modNames.ModuleName
where smsgs.MessageID = @msgId
Order by smsgs.Time DESC



Daniel Ratliff


The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material.  If you receive this 
material/information in error,
please contact the sender and delete or destroy the material/information.


Reply via email to