Home Forums SQL Server 2008 Security (SS2K8) Logon Triggers. A good idea? Or a nerve-racking exprience? RE: Logon Triggers. A good idea? Or a nerve-racking exprience?

  • GSquared (1/12/2012)


    But you can query trace files directly, without the import step, by using fn_trace_gettable(). That's what I usually do.

    taking that one step further, since you can directly query a trace, you can also create a a VIEW that contains that same query.

    then it's just a matter of querying the view on demand when you need to review it.

    here's a simple example of my default trace:

    CREATE VIEW dbo.VW_Trace_1

    AS

    SELECT

    ev.name ,

    tr.*

    FROM ::fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\log_63.trc', default) tr

    INNER join sys.trace_events ev

    ON tr.eventclass = ev.trace_event_id

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!