Our system spans multiple servers and the logs are stored in a central database. Each application flows through a decision tree, with each 'box' being a step. One of the things I am responsible for is tracking errors. The errors can happen at any step in the decision flow, which then defaults to step 800.20. I would like to be able to identify the step prior to 800.20 in each transaction without having to export the data into Excel and manipulating it manually. An added complication is that one of the applications has two different kinds of errors: one which ends up terminating the transaction and one that is merely noted while the transaction continues, 800.20 and 800.10 respectively.
I've got a query that can find, for a given application during a specified time range, the transactions with errors. This was pretty easy, but only half of what I need. What I am hoping you can help me with is this: I want to identify which transactions hit steps 800.10 and/or 800.20 and then, for each transaction, return only the step immediately prior to 800.10/800.20.
Thanks,
Alex
PS: This is what I have so far:
SELECT
DateTime, Priority, Application, MachineName, TransID, Msg
FROM
Logger
WHERE
TransID in (
SELECT
TransID
FROM
Logger
WHERE
Msg = 'Stat Event 800.20 updated'
AND Application = 'Orders'
AND DateTime LIKE '20091214%'
)
AND Msg LIKE '%Running Step%'
AND Application = 'Orders'
AND DateTime LIKE '20091214%'
ORDER BY
TransID, DateTime
I've got a query that can find, for a given application during a specified time range, the transactions with errors. This was pretty easy, but only half of what I need. What I am hoping you can help me with is this: I want to identify which transactions hit steps 800.10 and/or 800.20 and then, for each transaction, return only the step immediately prior to 800.10/800.20.
Thanks,
Alex
PS: This is what I have so far:
SELECT
DateTime, Priority, Application, MachineName, TransID, Msg
FROM
Logger
WHERE
TransID in (
SELECT
TransID
FROM
Logger
WHERE
Msg = 'Stat Event 800.20 updated'
AND Application = 'Orders'
AND DateTime LIKE '20091214%'
)
AND Msg LIKE '%Running Step%'
AND Application = 'Orders'
AND DateTime LIKE '20091214%'
ORDER BY
TransID, DateTime