empty server side trace

  • so I created a server side trace. ran it in development and works prefectly fine. I was able to capture activity that I wanted to capture. but when I run the same trace in production it didnt capture anything at all except follwing two lines:

    Trace Start

    Trace Stop

    Trace does create new files but all the files have only two lines.. trace start and trace stopped... I cant figure out why it isn't running that same way as in dev.

    No other activity is being caught. I wonder why that might be the case. My dev SQL is SQL Server 2005 sp3 whereas Prod is sp2.

    Any thoughts what may be happening here?

  • wierd; do you have any filters in the trace script that might not be the same, you know, like filtering for a specific databaasename or dbid, and it doesn't exist on production?

    can you paste the script?

    I've got a handy script that adds the comments and defines the filters as the output of reverse engineering trace, that might help us see the issue.

    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!

  • I do have some filters. I am running exact trace in production and dev. here is my trace definition:

    /****************************************************/

    /* Created by: SQL Server Profiler 2005 */

    /* Date: 05/19/2011 11:11:13 AM */

    /****************************************************/

    -- Create a Queue

    declare @rc int

    declare @TraceID int

    declare @maxfilesize bigint

    set @maxfilesize = 5

    -- Please replace the text InsertFileNameHere, with an appropriate

    -- filename prefixed by a path, e.g., c:\MyFolder\MyTrace. The .trc extension

    -- will be appended to the filename automatically. If you are writing from

    -- remote server to local drive, please use UNC path and make sure server has

    -- write access to your network share

    exec @rc = sp_trace_create @TraceID output,

    @options = 6,

    @tracefile = N'S:\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ServerSideTrace\Test',

    @maxfilesize = @maxfilesize,

    @stoptime = NULL,

    @filecount = 10

    if (@rc != 0) goto error

    -- Client side File and Table cannot be scripted

    -- Set the events

    declare @on bit

    set @on = 1

    exec sp_trace_setevent @TraceID, 10, 7, @on

    exec sp_trace_setevent @TraceID, 10, 31, @on

    exec sp_trace_setevent @TraceID, 10, 48, @on

    exec sp_trace_setevent @TraceID, 10, 64, @on

    exec sp_trace_setevent @TraceID, 10, 41, @on

    exec sp_trace_setevent @TraceID, 10, 49, @on

    exec sp_trace_setevent @TraceID, 10, 26, @on

    exec sp_trace_setevent @TraceID, 10, 35, @on

    exec sp_trace_setevent @TraceID, 10, 12, @on

    exec sp_trace_setevent @TraceID, 10, 60, @on

    exec sp_trace_setevent @TraceID, 10, 1, @on --TextData

    exec sp_trace_setevent @TraceID, 10, 3, @on -- DatabaseID

    exec sp_trace_setevent @TraceID, 10, 6, @on-- NTUserName

    exec sp_trace_setevent @TraceID, 10, 8, @on-- ClientHostName

    exec sp_trace_setevent @TraceID, 10, 10, @on-- Application Name

    exec sp_trace_setevent @TraceID, 10, 11, @on--SQL Security Login Name

    exec sp_trace_setevent @TraceID, 10, 10, @on--SPID

    exec sp_trace_setevent @TraceID, 10, 14, @on--StartTime

    exec sp_trace_setevent @TraceID, 10, 15, @on--EndTime

    exec sp_trace_setevent @TraceID, 10, 22, @on--ObjectId

    exec sp_trace_setevent @TraceID, 10, 23, @on--Success

    exec sp_trace_setevent @TraceID, 10, 28, @on--ObjectType

    exec sp_trace_setevent @TraceID, 10, 34, @on--ObjectName

    exec sp_trace_setevent @TraceID, 43, 7, @on

    exec sp_trace_setevent @TraceID, 43, 8, @on

    exec sp_trace_setevent @TraceID, 43, 48, @on

    exec sp_trace_setevent @TraceID, 43, 64, @on

    exec sp_trace_setevent @TraceID, 43, 1, @on

    exec sp_trace_setevent @TraceID, 43, 41, @on

    exec sp_trace_setevent @TraceID, 43, 49, @on

    exec sp_trace_setevent @TraceID, 43, 10, @on

    exec sp_trace_setevent @TraceID, 43, 26, @on

    exec sp_trace_setevent @TraceID, 43, 34, @on

    exec sp_trace_setevent @TraceID, 43, 3, @on

    exec sp_trace_setevent @TraceID, 43, 11, @on

    exec sp_trace_setevent @TraceID, 43, 35, @on

    exec sp_trace_setevent @TraceID, 43, 12, @on

    exec sp_trace_setevent @TraceID, 43, 28, @on

    exec sp_trace_setevent @TraceID, 43, 60, @on

    exec sp_trace_setevent @TraceID, 43, 5, @on

    exec sp_trace_setevent @TraceID, 43, 29, @on

    exec sp_trace_setevent @TraceID, 43, 6, @on

    exec sp_trace_setevent @TraceID, 43, 22, @on

    exec sp_trace_setevent @TraceID, 43, 62, @on

    exec sp_trace_setevent @TraceID, 45, 7, @on

    exec sp_trace_setevent @TraceID, 45, 55, @on

    exec sp_trace_setevent @TraceID, 45, 8, @on

    exec sp_trace_setevent @TraceID, 45, 48, @on

    exec sp_trace_setevent @TraceID, 45, 64, @on

    exec sp_trace_setevent @TraceID, 45, 1, @on

    exec sp_trace_setevent @TraceID, 45, 25, @on

    exec sp_trace_setevent @TraceID, 45, 41, @on

    exec sp_trace_setevent @TraceID, 45, 49, @on

    exec sp_trace_setevent @TraceID, 45, 10, @on

    exec sp_trace_setevent @TraceID, 45, 26, @on

    exec sp_trace_setevent @TraceID, 45, 34, @on

    exec sp_trace_setevent @TraceID, 45, 3, @on

    exec sp_trace_setevent @TraceID, 45, 11, @on

    exec sp_trace_setevent @TraceID, 45, 35, @on

    exec sp_trace_setevent @TraceID, 45, 12, @on

    exec sp_trace_setevent @TraceID, 45, 28, @on

    exec sp_trace_setevent @TraceID, 45, 60, @on

    exec sp_trace_setevent @TraceID, 45, 5, @on

    exec sp_trace_setevent @TraceID, 45, 29, @on

    exec sp_trace_setevent @TraceID, 45, 61, @on

    exec sp_trace_setevent @TraceID, 45, 6, @on

    exec sp_trace_setevent @TraceID, 45, 22, @on

    exec sp_trace_setevent @TraceID, 45, 62, @on

    exec sp_trace_setevent @TraceID, 12, 7, @on

    exec sp_trace_setevent @TraceID, 12, 31, @on

    exec sp_trace_setevent @TraceID, 12, 8, @on

    exec sp_trace_setevent @TraceID, 12, 48, @on

    exec sp_trace_setevent @TraceID, 12, 64, @on

    exec sp_trace_setevent @TraceID, 12, 1, @on

    exec sp_trace_setevent @TraceID, 12, 41, @on

    exec sp_trace_setevent @TraceID, 12, 49, @on

    exec sp_trace_setevent @TraceID, 12, 6, @on

    exec sp_trace_setevent @TraceID, 12, 10, @on

    exec sp_trace_setevent @TraceID, 12, 26, @on

    exec sp_trace_setevent @TraceID, 12, 3, @on

    exec sp_trace_setevent @TraceID, 12, 11, @on

    exec sp_trace_setevent @TraceID, 12, 35, @on

    exec sp_trace_setevent @TraceID, 12, 12, @on

    exec sp_trace_setevent @TraceID, 12, 60, @on

    exec sp_trace_setevent @TraceID, 41, 7, @on

    exec sp_trace_setevent @TraceID, 41, 55, @on

    exec sp_trace_setevent @TraceID, 41, 8, @on

    exec sp_trace_setevent @TraceID, 41, 48, @on

    exec sp_trace_setevent @TraceID, 41, 64, @on

    exec sp_trace_setevent @TraceID, 41, 1, @on

    exec sp_trace_setevent @TraceID, 41, 25, @on

    exec sp_trace_setevent @TraceID, 41, 41, @on

    exec sp_trace_setevent @TraceID, 41, 49, @on

    exec sp_trace_setevent @TraceID, 41, 10, @on

    exec sp_trace_setevent @TraceID, 41, 26, @on

    exec sp_trace_setevent @TraceID, 41, 3, @on

    exec sp_trace_setevent @TraceID, 41, 11, @on

    exec sp_trace_setevent @TraceID, 41, 35, @on

    exec sp_trace_setevent @TraceID, 41, 12, @on

    exec sp_trace_setevent @TraceID, 41, 60, @on

    exec sp_trace_setevent @TraceID, 41, 5, @on

    exec sp_trace_setevent @TraceID, 41, 29, @on

    exec sp_trace_setevent @TraceID, 41, 61, @on

    exec sp_trace_setevent @TraceID, 41, 6, @on

    -- Set the Filters

    declare @intfilter int

    declare @bigintfilter bigint

    set @intfilter = 60

    exec sp_trace_setfilter @TraceID, 3, 1, 0, @intfilter

    exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQL Server Profiler - 993c4f6b-7e4c-4129-818d-74f0011712f9' -- AND

    exec sp_trace_setfilter @TraceID, 35, 0, 6, N'Customer' -- AND

    exec sp_trace_setfilter @TraceID, 1, 0, 6, N'UPDATE%' -- AND

    exec sp_trace_setfilter @TraceID, 1, 1, 6, N'INSERT%' -- OR

    exec sp_trace_setfilter @TraceID, 1, 1, 6, N'DELETE%' -- OR

    exec sp_trace_setfilter @TraceID, 11, 0, 6, N'\%' -- AND

    -- Set the trace status to start

    exec sp_trace_setstatus @TraceID, 1

    -- display trace id for future references

    select TraceID=@TraceID

    goto finish

    error:

    select ErrorCode=@rc

    finish:

    go

    --Status Description

    --0 Stops the specified trace.

    --1 Starts the specified trace.

    --2 Closes the specified trace and deletes its definition from the server.

    -- sp_trace_setstatus @traceid=2, @status =0 -- stops the trace

    -- sp_trace_setstatus @traceid=2, @status =2 -- closes and deletes the trace from server

  • yep, it's scripted for one specific database id:

    exec sp_trace_setfilter @traceidout,3,0,0, N'60' -- AND DatabaseID = 60

    it's from this non-obvious snippet:

    set @intfilter = 60

    exec sp_trace_setfilter @TraceID, 3, 1, 0, @intfilter

    remove that or change it to the right ID.

    --declare variables for parameterizing the command

    declare @traceidout int

    declare @options int

    declare @path nvarchar(256)

    declare @maxfilesize bigint

    declare @maxRolloverFiles int

    declare @stoptime datetime

    declare @on bit

    set @on = 1 --for scripting purposes, I think its better Always setting a script to start the trace after creation.

    set @maxfilesize = 5 --size in MB

    set @maxRolloverFiles = 10 --number of files; ie if 5 files, start rewriting on rollover

    set @stoptime = NULL -- null if never ends, else a specific date

    set @options = 6

    set @path = 'c:\Data\Test' -- the trace adds ".trc" to the pathname, so avoiad "name.trc.trc" by removing it for scripting

    --create the trace

    exec sp_trace_create @traceidout output, @options, @path, @maxfilesize, @stoptime, @maxRolloverFiles

    --for the Event Every SQL statement completed, capture columns of accessible data

    exec sp_trace_setevent @traceidout,18,6,@on --Audit Server Starts And Stops,NTUserName

    exec sp_trace_setevent @traceidout,18,7,@on --Audit Server Starts And Stops,NTDomainName

    exec sp_trace_setevent @traceidout,18,8,@on --Audit Server Starts And Stops,HostName

    exec sp_trace_setevent @traceidout,18,9,@on --Audit Server Starts And Stops,ClientProcessID

    exec sp_trace_setevent @traceidout,18,10,@on --Audit Server Starts And Stops,ApplicationName

    exec sp_trace_setevent @traceidout,18,11,@on --Audit Server Starts And Stops,LoginName

    exec sp_trace_setevent @traceidout,18,49,@on --Audit Server Starts And Stops,RequestID

    exec sp_trace_setevent @traceidout,18,51,@on --Audit Server Starts And Stops,EventSequence

    exec sp_trace_setevent @traceidout,18,60,@on --Audit Server Starts And Stops,IsSystem

    exec sp_trace_setevent @traceidout,18,64,@on --Audit Server Starts And Stops,SessionLoginName

    exec sp_trace_setevent @traceidout,18,12,@on --Audit Server Starts And Stops,SPID

    exec sp_trace_setevent @traceidout,18,14,@on --Audit Server Starts And Stops,StartTime

    exec sp_trace_setevent @traceidout,18,21,@on --Audit Server Starts And Stops,EventSubClass

    exec sp_trace_setevent @traceidout,18,23,@on --Audit Server Starts And Stops,Success

    exec sp_trace_setevent @traceidout,18,26,@on --Audit Server Starts And Stops,ServerName

    exec sp_trace_setevent @traceidout,18,41,@on --Audit Server Starts And Stops,LoginSid

    exec sp_trace_setevent @traceidout,20,1,@on --Audit Login Failed,TextData

    exec sp_trace_setevent @traceidout,20,3,@on --Audit Login Failed,DatabaseID

    exec sp_trace_setevent @traceidout,20,6,@on --Audit Login Failed,NTUserName

    exec sp_trace_setevent @traceidout,20,7,@on --Audit Login Failed,NTDomainName

    exec sp_trace_setevent @traceidout,20,8,@on --Audit Login Failed,HostName

    exec sp_trace_setevent @traceidout,20,9,@on --Audit Login Failed,ClientProcessID

    exec sp_trace_setevent @traceidout,20,57,@on --Audit Login Failed,Type

    exec sp_trace_setevent @traceidout,20,60,@on --Audit Login Failed,IsSystem

    exec sp_trace_setevent @traceidout,20,64,@on --Audit Login Failed,SessionLoginName

    exec sp_trace_setevent @traceidout,20,26,@on --Audit Login Failed,ServerName

    exec sp_trace_setevent @traceidout,20,30,@on --Audit Login Failed,State

    exec sp_trace_setevent @traceidout,20,31,@on --Audit Login Failed,Error

    exec sp_trace_setevent @traceidout,20,35,@on --Audit Login Failed,DatabaseName

    exec sp_trace_setevent @traceidout,20,49,@on --Audit Login Failed,RequestID

    exec sp_trace_setevent @traceidout,20,51,@on --Audit Login Failed,EventSequence

    exec sp_trace_setevent @traceidout,20,10,@on --Audit Login Failed,ApplicationName

    exec sp_trace_setevent @traceidout,20,11,@on --Audit Login Failed,LoginName

    exec sp_trace_setevent @traceidout,20,12,@on --Audit Login Failed,SPID

    exec sp_trace_setevent @traceidout,20,14,@on --Audit Login Failed,StartTime

    exec sp_trace_setevent @traceidout,20,21,@on --Audit Login Failed,EventSubClass

    exec sp_trace_setevent @traceidout,20,23,@on --Audit Login Failed,Success

    exec sp_trace_setevent @traceidout,22,1,@on --ErrorLog,TextData

    exec sp_trace_setevent @traceidout,22,3,@on --ErrorLog,DatabaseID

    exec sp_trace_setevent @traceidout,22,4,@on --ErrorLog,TransactionID

    exec sp_trace_setevent @traceidout,22,6,@on --ErrorLog,NTUserName

    exec sp_trace_setevent @traceidout,22,7,@on --ErrorLog,NTDomainName

    exec sp_trace_setevent @traceidout,22,8,@on --ErrorLog,HostName

    exec sp_trace_setevent @traceidout,22,60,@on --ErrorLog,IsSystem

    exec sp_trace_setevent @traceidout,22,64,@on --ErrorLog,SessionLoginName

    exec sp_trace_setevent @traceidout,22,26,@on --ErrorLog,ServerName

    exec sp_trace_setevent @traceidout,22,31,@on --ErrorLog,Error

    exec sp_trace_setevent @traceidout,22,35,@on --ErrorLog,DatabaseName

    exec sp_trace_setevent @traceidout,22,41,@on --ErrorLog,LoginSid

    exec sp_trace_setevent @traceidout,22,49,@on --ErrorLog,RequestID

    exec sp_trace_setevent @traceidout,22,51,@on --ErrorLog,EventSequence

    exec sp_trace_setevent @traceidout,22,9,@on --ErrorLog,ClientProcessID

    exec sp_trace_setevent @traceidout,22,10,@on --ErrorLog,ApplicationName

    exec sp_trace_setevent @traceidout,22,11,@on --ErrorLog,LoginName

    exec sp_trace_setevent @traceidout,22,12,@on --ErrorLog,SPID

    exec sp_trace_setevent @traceidout,22,14,@on --ErrorLog,StartTime

    exec sp_trace_setevent @traceidout,22,20,@on --ErrorLog,Severity

    exec sp_trace_setevent @traceidout,46,3,@on --Object:Created,DatabaseID

    exec sp_trace_setevent @traceidout,46,4,@on --Object:Created,TransactionID

    exec sp_trace_setevent @traceidout,46,6,@on --Object:Created,NTUserName

    exec sp_trace_setevent @traceidout,46,7,@on --Object:Created,NTDomainName

    exec sp_trace_setevent @traceidout,46,8,@on --Object:Created,HostName

    exec sp_trace_setevent @traceidout,46,9,@on --Object:Created,ClientProcessID

    exec sp_trace_setevent @traceidout,46,60,@on --Object:Created,IsSystem

    exec sp_trace_setevent @traceidout,46,64,@on --Object:Created,SessionLoginName

    exec sp_trace_setevent @traceidout,46,66,@on --Object:Created,GroupID

    exec sp_trace_setevent @traceidout,46,41,@on --Object:Created,LoginSid

    exec sp_trace_setevent @traceidout,46,49,@on --Object:Created,RequestID

    exec sp_trace_setevent @traceidout,46,50,@on --Object:Created,XactSequence

    exec sp_trace_setevent @traceidout,46,51,@on --Object:Created,EventSequence

    exec sp_trace_setevent @traceidout,46,52,@on --Object:Created,BigintData1

    exec sp_trace_setevent @traceidout,46,56,@on --Object:Created,ObjectID2

    exec sp_trace_setevent @traceidout,46,24,@on --Object:Created,IndexID

    exec sp_trace_setevent @traceidout,46,25,@on --Object:Created,IntegerData

    exec sp_trace_setevent @traceidout,46,26,@on --Object:Created,ServerName

    exec sp_trace_setevent @traceidout,46,28,@on --Object:Created,ObjectType

    exec sp_trace_setevent @traceidout,46,34,@on --Object:Created,ObjectName

    exec sp_trace_setevent @traceidout,46,35,@on --Object:Created,DatabaseName

    exec sp_trace_setevent @traceidout,46,10,@on --Object:Created,ApplicationName

    exec sp_trace_setevent @traceidout,46,11,@on --Object:Created,LoginName

    exec sp_trace_setevent @traceidout,46,12,@on --Object:Created,SPID

    exec sp_trace_setevent @traceidout,46,14,@on --Object:Created,StartTime

    exec sp_trace_setevent @traceidout,46,21,@on --Object:Created,EventSubClass

    exec sp_trace_setevent @traceidout,46,22,@on --Object:Created,ObjectID

    exec sp_trace_setevent @traceidout,47,3,@on --Object:Deleted,DatabaseID

    exec sp_trace_setevent @traceidout,47,4,@on --Object:Deleted,TransactionID

    exec sp_trace_setevent @traceidout,47,6,@on --Object:Deleted,NTUserName

    exec sp_trace_setevent @traceidout,47,7,@on --Object:Deleted,NTDomainName

    exec sp_trace_setevent @traceidout,47,8,@on --Object:Deleted,HostName

    exec sp_trace_setevent @traceidout,47,9,@on --Object:Deleted,ClientProcessID

    exec sp_trace_setevent @traceidout,47,60,@on --Object:Deleted,IsSystem

    exec sp_trace_setevent @traceidout,47,64,@on --Object:Deleted,SessionLoginName

    exec sp_trace_setevent @traceidout,47,66,@on --Object:Deleted,GroupID

    exec sp_trace_setevent @traceidout,47,41,@on --Object:Deleted,LoginSid

    exec sp_trace_setevent @traceidout,47,49,@on --Object:Deleted,RequestID

    exec sp_trace_setevent @traceidout,47,50,@on --Object:Deleted,XactSequence

    exec sp_trace_setevent @traceidout,47,51,@on --Object:Deleted,EventSequence

    exec sp_trace_setevent @traceidout,47,52,@on --Object:Deleted,BigintData1

    exec sp_trace_setevent @traceidout,47,56,@on --Object:Deleted,ObjectID2

    exec sp_trace_setevent @traceidout,47,24,@on --Object:Deleted,IndexID

    exec sp_trace_setevent @traceidout,47,25,@on --Object:Deleted,IntegerData

    exec sp_trace_setevent @traceidout,47,26,@on --Object:Deleted,ServerName

    exec sp_trace_setevent @traceidout,47,28,@on --Object:Deleted,ObjectType

    exec sp_trace_setevent @traceidout,47,34,@on --Object:Deleted,ObjectName

    exec sp_trace_setevent @traceidout,47,35,@on --Object:Deleted,DatabaseName

    exec sp_trace_setevent @traceidout,47,10,@on --Object:Deleted,ApplicationName

    exec sp_trace_setevent @traceidout,47,11,@on --Object:Deleted,LoginName

    exec sp_trace_setevent @traceidout,47,12,@on --Object:Deleted,SPID

    exec sp_trace_setevent @traceidout,47,14,@on --Object:Deleted,StartTime

    exec sp_trace_setevent @traceidout,47,21,@on --Object:Deleted,EventSubClass

    exec sp_trace_setevent @traceidout,47,22,@on --Object:Deleted,ObjectID

    exec sp_trace_setevent @traceidout,55,3,@on --Hash Warning,DatabaseID

    exec sp_trace_setevent @traceidout,55,4,@on --Hash Warning,TransactionID

    exec sp_trace_setevent @traceidout,55,6,@on --Hash Warning,NTUserName

    exec sp_trace_setevent @traceidout,55,7,@on --Hash Warning,NTDomainName

    exec sp_trace_setevent @traceidout,55,8,@on --Hash Warning,HostName

    exec sp_trace_setevent @traceidout,55,9,@on --Hash Warning,ClientProcessID

    exec sp_trace_setevent @traceidout,55,51,@on --Hash Warning,EventSequence

    exec sp_trace_setevent @traceidout,55,60,@on --Hash Warning,IsSystem

    exec sp_trace_setevent @traceidout,55,64,@on --Hash Warning,SessionLoginName

    exec sp_trace_setevent @traceidout,55,66,@on --Hash Warning,GroupID

    exec sp_trace_setevent @traceidout,55,25,@on --Hash Warning,IntegerData

    exec sp_trace_setevent @traceidout,55,26,@on --Hash Warning,ServerName

    exec sp_trace_setevent @traceidout,55,35,@on --Hash Warning,DatabaseName

    exec sp_trace_setevent @traceidout,55,41,@on --Hash Warning,LoginSid

    exec sp_trace_setevent @traceidout,55,49,@on --Hash Warning,RequestID

    exec sp_trace_setevent @traceidout,55,50,@on --Hash Warning,XactSequence

    exec sp_trace_setevent @traceidout,55,10,@on --Hash Warning,ApplicationName

    exec sp_trace_setevent @traceidout,55,11,@on --Hash Warning,LoginName

    exec sp_trace_setevent @traceidout,55,12,@on --Hash Warning,SPID

    exec sp_trace_setevent @traceidout,55,14,@on --Hash Warning,StartTime

    exec sp_trace_setevent @traceidout,55,21,@on --Hash Warning,EventSubClass

    exec sp_trace_setevent @traceidout,55,22,@on --Hash Warning,ObjectID

    exec sp_trace_setevent @traceidout,69,3,@on --Sort Warnings,DatabaseID

    exec sp_trace_setevent @traceidout,69,4,@on --Sort Warnings,TransactionID

    exec sp_trace_setevent @traceidout,69,6,@on --Sort Warnings,NTUserName

    exec sp_trace_setevent @traceidout,69,7,@on --Sort Warnings,NTDomainName

    exec sp_trace_setevent @traceidout,69,8,@on --Sort Warnings,HostName

    exec sp_trace_setevent @traceidout,69,9,@on --Sort Warnings,ClientProcessID

    exec sp_trace_setevent @traceidout,69,64,@on --Sort Warnings,SessionLoginName

    exec sp_trace_setevent @traceidout,69,66,@on --Sort Warnings,GroupID

    exec sp_trace_setevent @traceidout,69,35,@on --Sort Warnings,DatabaseName

    exec sp_trace_setevent @traceidout,69,41,@on --Sort Warnings,LoginSid

    exec sp_trace_setevent @traceidout,69,49,@on --Sort Warnings,RequestID

    exec sp_trace_setevent @traceidout,69,50,@on --Sort Warnings,XactSequence

    exec sp_trace_setevent @traceidout,69,51,@on --Sort Warnings,EventSequence

    exec sp_trace_setevent @traceidout,69,60,@on --Sort Warnings,IsSystem

    exec sp_trace_setevent @traceidout,69,10,@on --Sort Warnings,ApplicationName

    exec sp_trace_setevent @traceidout,69,11,@on --Sort Warnings,LoginName

    exec sp_trace_setevent @traceidout,69,12,@on --Sort Warnings,SPID

    exec sp_trace_setevent @traceidout,69,14,@on --Sort Warnings,StartTime

    exec sp_trace_setevent @traceidout,69,21,@on --Sort Warnings,EventSubClass

    exec sp_trace_setevent @traceidout,69,26,@on --Sort Warnings,ServerName

    exec sp_trace_setevent @traceidout,79,1,@on --Missing Column Statistics,TextData

    exec sp_trace_setevent @traceidout,79,3,@on --Missing Column Statistics,DatabaseID

    exec sp_trace_setevent @traceidout,79,4,@on --Missing Column Statistics,TransactionID

    exec sp_trace_setevent @traceidout,79,6,@on --Missing Column Statistics,NTUserName

    exec sp_trace_setevent @traceidout,79,7,@on --Missing Column Statistics,NTDomainName

    exec sp_trace_setevent @traceidout,79,8,@on --Missing Column Statistics,HostName

    exec sp_trace_setevent @traceidout,79,64,@on --Missing Column Statistics,SessionLoginName

    exec sp_trace_setevent @traceidout,79,66,@on --Missing Column Statistics,GroupID

    exec sp_trace_setevent @traceidout,79,35,@on --Missing Column Statistics,DatabaseName

    exec sp_trace_setevent @traceidout,79,41,@on --Missing Column Statistics,LoginSid

    exec sp_trace_setevent @traceidout,79,49,@on --Missing Column Statistics,RequestID

    exec sp_trace_setevent @traceidout,79,50,@on --Missing Column Statistics,XactSequence

    exec sp_trace_setevent @traceidout,79,51,@on --Missing Column Statistics,EventSequence

    exec sp_trace_setevent @traceidout,79,60,@on --Missing Column Statistics,IsSystem

    exec sp_trace_setevent @traceidout,79,9,@on --Missing Column Statistics,ClientProcessID

    exec sp_trace_setevent @traceidout,79,10,@on --Missing Column Statistics,ApplicationName

    exec sp_trace_setevent @traceidout,79,11,@on --Missing Column Statistics,LoginName

    exec sp_trace_setevent @traceidout,79,12,@on --Missing Column Statistics,SPID

    exec sp_trace_setevent @traceidout,79,14,@on --Missing Column Statistics,StartTime

    exec sp_trace_setevent @traceidout,79,26,@on --Missing Column Statistics,ServerName

    exec sp_trace_setevent @traceidout,80,3,@on --Missing Join Predicate,DatabaseID

    exec sp_trace_setevent @traceidout,80,4,@on --Missing Join Predicate,TransactionID

    exec sp_trace_setevent @traceidout,80,6,@on --Missing Join Predicate,NTUserName

    exec sp_trace_setevent @traceidout,80,7,@on --Missing Join Predicate,NTDomainName

    exec sp_trace_setevent @traceidout,80,8,@on --Missing Join Predicate,HostName

    exec sp_trace_setevent @traceidout,80,9,@on --Missing Join Predicate,ClientProcessID

    exec sp_trace_setevent @traceidout,80,66,@on --Missing Join Predicate,GroupID

    exec sp_trace_setevent @traceidout,80,41,@on --Missing Join Predicate,LoginSid

    exec sp_trace_setevent @traceidout,80,49,@on --Missing Join Predicate,RequestID

    exec sp_trace_setevent @traceidout,80,50,@on --Missing Join Predicate,XactSequence

    exec sp_trace_setevent @traceidout,80,51,@on --Missing Join Predicate,EventSequence

    exec sp_trace_setevent @traceidout,80,60,@on --Missing Join Predicate,IsSystem

    exec sp_trace_setevent @traceidout,80,64,@on --Missing Join Predicate,SessionLoginName

    exec sp_trace_setevent @traceidout,80,10,@on --Missing Join Predicate,ApplicationName

    exec sp_trace_setevent @traceidout,80,11,@on --Missing Join Predicate,LoginName

    exec sp_trace_setevent @traceidout,80,12,@on --Missing Join Predicate,SPID

    exec sp_trace_setevent @traceidout,80,14,@on --Missing Join Predicate,StartTime

    exec sp_trace_setevent @traceidout,80,26,@on --Missing Join Predicate,ServerName

    exec sp_trace_setevent @traceidout,80,35,@on --Missing Join Predicate,DatabaseName

    exec sp_trace_setevent @traceidout,81,4,@on --Server Memory Change,TransactionID

    exec sp_trace_setevent @traceidout,81,12,@on --Server Memory Change,SPID

    exec sp_trace_setevent @traceidout,81,14,@on --Server Memory Change,StartTime

    exec sp_trace_setevent @traceidout,81,21,@on --Server Memory Change,EventSubClass

    exec sp_trace_setevent @traceidout,81,25,@on --Server Memory Change,IntegerData

    exec sp_trace_setevent @traceidout,81,26,@on --Server Memory Change,ServerName

    exec sp_trace_setevent @traceidout,81,49,@on --Server Memory Change,RequestID

    exec sp_trace_setevent @traceidout,81,50,@on --Server Memory Change,XactSequence

    exec sp_trace_setevent @traceidout,81,51,@on --Server Memory Change,EventSequence

    exec sp_trace_setevent @traceidout,81,60,@on --Server Memory Change,IsSystem

    exec sp_trace_setevent @traceidout,81,64,@on --Server Memory Change,SessionLoginName

    exec sp_trace_setevent @traceidout,92,3,@on --Data File Auto Grow,DatabaseID

    exec sp_trace_setevent @traceidout,92,7,@on --Data File Auto Grow,NTDomainName

    exec sp_trace_setevent @traceidout,92,8,@on --Data File Auto Grow,HostName

    exec sp_trace_setevent @traceidout,92,9,@on --Data File Auto Grow,ClientProcessID

    exec sp_trace_setevent @traceidout,92,10,@on --Data File Auto Grow,ApplicationName

    exec sp_trace_setevent @traceidout,92,11,@on --Data File Auto Grow,LoginName

    exec sp_trace_setevent @traceidout,92,35,@on --Data File Auto Grow,DatabaseName

    exec sp_trace_setevent @traceidout,92,36,@on --Data File Auto Grow,FileName

    exec sp_trace_setevent @traceidout,92,41,@on --Data File Auto Grow,LoginSid

    exec sp_trace_setevent @traceidout,92,51,@on --Data File Auto Grow,EventSequence

    exec sp_trace_setevent @traceidout,92,60,@on --Data File Auto Grow,IsSystem

    exec sp_trace_setevent @traceidout,92,64,@on --Data File Auto Grow,SessionLoginName

    exec sp_trace_setevent @traceidout,92,12,@on --Data File Auto Grow,SPID

    exec sp_trace_setevent @traceidout,92,13,@on --Data File Auto Grow,Duration

    exec sp_trace_setevent @traceidout,92,14,@on --Data File Auto Grow,StartTime

    exec sp_trace_setevent @traceidout,92,15,@on --Data File Auto Grow,EndTime

    exec sp_trace_setevent @traceidout,92,25,@on --Data File Auto Grow,IntegerData

    exec sp_trace_setevent @traceidout,92,26,@on --Data File Auto Grow,ServerName

    exec sp_trace_setevent @traceidout,93,3,@on --Log File Auto Grow,DatabaseID

    exec sp_trace_setevent @traceidout,93,7,@on --Log File Auto Grow,NTDomainName

    exec sp_trace_setevent @traceidout,93,8,@on --Log File Auto Grow,HostName

    exec sp_trace_setevent @traceidout,93,9,@on --Log File Auto Grow,ClientProcessID

    exec sp_trace_setevent @traceidout,93,10,@on --Log File Auto Grow,ApplicationName

    exec sp_trace_setevent @traceidout,93,11,@on --Log File Auto Grow,LoginName

    exec sp_trace_setevent @traceidout,93,35,@on --Log File Auto Grow,DatabaseName

    exec sp_trace_setevent @traceidout,93,36,@on --Log File Auto Grow,FileName

    exec sp_trace_setevent @traceidout,93,41,@on --Log File Auto Grow,LoginSid

    exec sp_trace_setevent @traceidout,93,51,@on --Log File Auto Grow,EventSequence

    exec sp_trace_setevent @traceidout,93,60,@on --Log File Auto Grow,IsSystem

    exec sp_trace_setevent @traceidout,93,64,@on --Log File Auto Grow,SessionLoginName

    exec sp_trace_setevent @traceidout,93,12,@on --Log File Auto Grow,SPID

    exec sp_trace_setevent @traceidout,93,13,@on --Log File Auto Grow,Duration

    exec sp_trace_setevent @traceidout,93,14,@on --Log File Auto Grow,StartTime

    exec sp_trace_setevent @traceidout,93,15,@on --Log File Auto Grow,EndTime

    exec sp_trace_setevent @traceidout,93,25,@on --Log File Auto Grow,IntegerData

    exec sp_trace_setevent @traceidout,93,26,@on --Log File Auto Grow,ServerName

    exec sp_trace_setevent @traceidout,94,3,@on --Data File Auto Shrink,DatabaseID

    exec sp_trace_setevent @traceidout,94,7,@on --Data File Auto Shrink,NTDomainName

    exec sp_trace_setevent @traceidout,94,8,@on --Data File Auto Shrink,HostName

    exec sp_trace_setevent @traceidout,94,9,@on --Data File Auto Shrink,ClientProcessID

    exec sp_trace_setevent @traceidout,94,10,@on --Data File Auto Shrink,ApplicationName

    exec sp_trace_setevent @traceidout,94,11,@on --Data File Auto Shrink,LoginName

    exec sp_trace_setevent @traceidout,94,35,@on --Data File Auto Shrink,DatabaseName

    exec sp_trace_setevent @traceidout,94,36,@on --Data File Auto Shrink,FileName

    exec sp_trace_setevent @traceidout,94,41,@on --Data File Auto Shrink,LoginSid

    exec sp_trace_setevent @traceidout,94,51,@on --Data File Auto Shrink,EventSequence

    exec sp_trace_setevent @traceidout,94,60,@on --Data File Auto Shrink,IsSystem

    exec sp_trace_setevent @traceidout,94,64,@on --Data File Auto Shrink,SessionLoginName

    exec sp_trace_setevent @traceidout,94,12,@on --Data File Auto Shrink,SPID

    exec sp_trace_setevent @traceidout,94,13,@on --Data File Auto Shrink,Duration

    exec sp_trace_setevent @traceidout,94,14,@on --Data File Auto Shrink,StartTime

    exec sp_trace_setevent @traceidout,94,15,@on --Data File Auto Shrink,EndTime

    exec sp_trace_setevent @traceidout,94,25,@on --Data File Auto Shrink,IntegerData

    exec sp_trace_setevent @traceidout,94,26,@on --Data File Auto Shrink,ServerName

    exec sp_trace_setevent @traceidout,95,3,@on --Log File Auto Shrink,DatabaseID

    exec sp_trace_setevent @traceidout,95,7,@on --Log File Auto Shrink,NTDomainName

    exec sp_trace_setevent @traceidout,95,8,@on --Log File Auto Shrink,HostName

    exec sp_trace_setevent @traceidout,95,9,@on --Log File Auto Shrink,ClientProcessID

    exec sp_trace_setevent @traceidout,95,10,@on --Log File Auto Shrink,ApplicationName

    exec sp_trace_setevent @traceidout,95,11,@on --Log File Auto Shrink,LoginName

    exec sp_trace_setevent @traceidout,95,35,@on --Log File Auto Shrink,DatabaseName

    exec sp_trace_setevent @traceidout,95,36,@on --Log File Auto Shrink,FileName

    exec sp_trace_setevent @traceidout,95,41,@on --Log File Auto Shrink,LoginSid

    exec sp_trace_setevent @traceidout,95,51,@on --Log File Auto Shrink,EventSequence

    exec sp_trace_setevent @traceidout,95,60,@on --Log File Auto Shrink,IsSystem

    exec sp_trace_setevent @traceidout,95,64,@on --Log File Auto Shrink,SessionLoginName

    exec sp_trace_setevent @traceidout,95,12,@on --Log File Auto Shrink,SPID

    exec sp_trace_setevent @traceidout,95,13,@on --Log File Auto Shrink,Duration

    exec sp_trace_setevent @traceidout,95,14,@on --Log File Auto Shrink,StartTime

    exec sp_trace_setevent @traceidout,95,15,@on --Log File Auto Shrink,EndTime

    exec sp_trace_setevent @traceidout,95,25,@on --Log File Auto Shrink,IntegerData

    exec sp_trace_setevent @traceidout,95,26,@on --Log File Auto Shrink,ServerName

    exec sp_trace_setevent @traceidout,102,1,@on --Audit Database Scope GDR Event,TextData

    exec sp_trace_setevent @traceidout,102,3,@on --Audit Database Scope GDR Event,DatabaseID

    exec sp_trace_setevent @traceidout,102,4,@on --Audit Database Scope GDR Event,TransactionID

    exec sp_trace_setevent @traceidout,102,5,@on --Audit Database Scope GDR Event,LineNumber

    exec sp_trace_setevent @traceidout,102,6,@on --Audit Database Scope GDR Event,NTUserName

    exec sp_trace_setevent @traceidout,102,7,@on --Audit Database Scope GDR Event,NTDomainName

    exec sp_trace_setevent @traceidout,102,64,@on --Audit Database Scope GDR Event,SessionLoginName

    exec sp_trace_setevent @traceidout,102,42,@on --Audit Database Scope GDR Event,TargetLoginName

    exec sp_trace_setevent @traceidout,102,43,@on --Audit Database Scope GDR Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,102,49,@on --Audit Database Scope GDR Event,RequestID

    exec sp_trace_setevent @traceidout,102,50,@on --Audit Database Scope GDR Event,XactSequence

    exec sp_trace_setevent @traceidout,102,51,@on --Audit Database Scope GDR Event,EventSequence

    exec sp_trace_setevent @traceidout,102,60,@on --Audit Database Scope GDR Event,IsSystem

    exec sp_trace_setevent @traceidout,102,34,@on --Audit Database Scope GDR Event,ObjectName

    exec sp_trace_setevent @traceidout,102,35,@on --Audit Database Scope GDR Event,DatabaseName

    exec sp_trace_setevent @traceidout,102,37,@on --Audit Database Scope GDR Event,OwnerName

    exec sp_trace_setevent @traceidout,102,39,@on --Audit Database Scope GDR Event,TargetUserName

    exec sp_trace_setevent @traceidout,102,40,@on --Audit Database Scope GDR Event,DBUserName

    exec sp_trace_setevent @traceidout,102,41,@on --Audit Database Scope GDR Event,LoginSid

    exec sp_trace_setevent @traceidout,102,19,@on --Audit Database Scope GDR Event,Permissions

    exec sp_trace_setevent @traceidout,102,21,@on --Audit Database Scope GDR Event,EventSubClass

    exec sp_trace_setevent @traceidout,102,23,@on --Audit Database Scope GDR Event,Success

    exec sp_trace_setevent @traceidout,102,26,@on --Audit Database Scope GDR Event,ServerName

    exec sp_trace_setevent @traceidout,102,28,@on --Audit Database Scope GDR Event,ObjectType

    exec sp_trace_setevent @traceidout,102,29,@on --Audit Database Scope GDR Event,NestLevel

    exec sp_trace_setevent @traceidout,102,8,@on --Audit Database Scope GDR Event,HostName

    exec sp_trace_setevent @traceidout,102,9,@on --Audit Database Scope GDR Event,ClientProcessID

    exec sp_trace_setevent @traceidout,102,10,@on --Audit Database Scope GDR Event,ApplicationName

    exec sp_trace_setevent @traceidout,102,11,@on --Audit Database Scope GDR Event,LoginName

    exec sp_trace_setevent @traceidout,102,12,@on --Audit Database Scope GDR Event,SPID

    exec sp_trace_setevent @traceidout,102,14,@on --Audit Database Scope GDR Event,StartTime

    exec sp_trace_setevent @traceidout,103,1,@on --Audit Schema Object GDR Event,TextData

    exec sp_trace_setevent @traceidout,103,3,@on --Audit Schema Object GDR Event,DatabaseID

    exec sp_trace_setevent @traceidout,103,4,@on --Audit Schema Object GDR Event,TransactionID

    exec sp_trace_setevent @traceidout,103,5,@on --Audit Schema Object GDR Event,LineNumber

    exec sp_trace_setevent @traceidout,103,6,@on --Audit Schema Object GDR Event,NTUserName

    exec sp_trace_setevent @traceidout,103,7,@on --Audit Schema Object GDR Event,NTDomainName

    exec sp_trace_setevent @traceidout,103,59,@on --Audit Schema Object GDR Event,ParentName

    exec sp_trace_setevent @traceidout,103,60,@on --Audit Schema Object GDR Event,IsSystem

    exec sp_trace_setevent @traceidout,103,64,@on --Audit Schema Object GDR Event,SessionLoginName

    exec sp_trace_setevent @traceidout,103,42,@on --Audit Schema Object GDR Event,TargetLoginName

    exec sp_trace_setevent @traceidout,103,43,@on --Audit Schema Object GDR Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,103,44,@on --Audit Schema Object GDR Event,ColumnPermissions

    exec sp_trace_setevent @traceidout,103,49,@on --Audit Schema Object GDR Event,RequestID

    exec sp_trace_setevent @traceidout,103,50,@on --Audit Schema Object GDR Event,XactSequence

    exec sp_trace_setevent @traceidout,103,51,@on --Audit Schema Object GDR Event,EventSequence

    exec sp_trace_setevent @traceidout,103,34,@on --Audit Schema Object GDR Event,ObjectName

    exec sp_trace_setevent @traceidout,103,35,@on --Audit Schema Object GDR Event,DatabaseName

    exec sp_trace_setevent @traceidout,103,37,@on --Audit Schema Object GDR Event,OwnerName

    exec sp_trace_setevent @traceidout,103,39,@on --Audit Schema Object GDR Event,TargetUserName

    exec sp_trace_setevent @traceidout,103,40,@on --Audit Schema Object GDR Event,DBUserName

    exec sp_trace_setevent @traceidout,103,41,@on --Audit Schema Object GDR Event,LoginSid

    exec sp_trace_setevent @traceidout,103,19,@on --Audit Schema Object GDR Event,Permissions

    exec sp_trace_setevent @traceidout,103,21,@on --Audit Schema Object GDR Event,EventSubClass

    exec sp_trace_setevent @traceidout,103,23,@on --Audit Schema Object GDR Event,Success

    exec sp_trace_setevent @traceidout,103,26,@on --Audit Schema Object GDR Event,ServerName

    exec sp_trace_setevent @traceidout,103,28,@on --Audit Schema Object GDR Event,ObjectType

    exec sp_trace_setevent @traceidout,103,29,@on --Audit Schema Object GDR Event,NestLevel

    exec sp_trace_setevent @traceidout,103,8,@on --Audit Schema Object GDR Event,HostName

    exec sp_trace_setevent @traceidout,103,9,@on --Audit Schema Object GDR Event,ClientProcessID

    exec sp_trace_setevent @traceidout,103,10,@on --Audit Schema Object GDR Event,ApplicationName

    exec sp_trace_setevent @traceidout,103,11,@on --Audit Schema Object GDR Event,LoginName

    exec sp_trace_setevent @traceidout,103,12,@on --Audit Schema Object GDR Event,SPID

    exec sp_trace_setevent @traceidout,103,14,@on --Audit Schema Object GDR Event,StartTime

    exec sp_trace_setevent @traceidout,104,3,@on --Audit Addlogin Event,DatabaseID

    exec sp_trace_setevent @traceidout,104,4,@on --Audit Addlogin Event,TransactionID

    exec sp_trace_setevent @traceidout,104,5,@on --Audit Addlogin Event,LineNumber

    exec sp_trace_setevent @traceidout,104,6,@on --Audit Addlogin Event,NTUserName

    exec sp_trace_setevent @traceidout,104,7,@on --Audit Addlogin Event,NTDomainName

    exec sp_trace_setevent @traceidout,104,8,@on --Audit Addlogin Event,HostName

    exec sp_trace_setevent @traceidout,104,64,@on --Audit Addlogin Event,SessionLoginName

    exec sp_trace_setevent @traceidout,104,42,@on --Audit Addlogin Event,TargetLoginName

    exec sp_trace_setevent @traceidout,104,43,@on --Audit Addlogin Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,104,49,@on --Audit Addlogin Event,RequestID

    exec sp_trace_setevent @traceidout,104,50,@on --Audit Addlogin Event,XactSequence

    exec sp_trace_setevent @traceidout,104,51,@on --Audit Addlogin Event,EventSequence

    exec sp_trace_setevent @traceidout,104,60,@on --Audit Addlogin Event,IsSystem

    exec sp_trace_setevent @traceidout,104,23,@on --Audit Addlogin Event,Success

    exec sp_trace_setevent @traceidout,104,26,@on --Audit Addlogin Event,ServerName

    exec sp_trace_setevent @traceidout,104,28,@on --Audit Addlogin Event,ObjectType

    exec sp_trace_setevent @traceidout,104,35,@on --Audit Addlogin Event,DatabaseName

    exec sp_trace_setevent @traceidout,104,40,@on --Audit Addlogin Event,DBUserName

    exec sp_trace_setevent @traceidout,104,41,@on --Audit Addlogin Event,LoginSid

    exec sp_trace_setevent @traceidout,104,9,@on --Audit Addlogin Event,ClientProcessID

    exec sp_trace_setevent @traceidout,104,10,@on --Audit Addlogin Event,ApplicationName

    exec sp_trace_setevent @traceidout,104,11,@on --Audit Addlogin Event,LoginName

    exec sp_trace_setevent @traceidout,104,12,@on --Audit Addlogin Event,SPID

    exec sp_trace_setevent @traceidout,104,14,@on --Audit Addlogin Event,StartTime

    exec sp_trace_setevent @traceidout,104,21,@on --Audit Addlogin Event,EventSubClass

    exec sp_trace_setevent @traceidout,105,3,@on --Audit Login GDR Event,DatabaseID

    exec sp_trace_setevent @traceidout,105,4,@on --Audit Login GDR Event,TransactionID

    exec sp_trace_setevent @traceidout,105,6,@on --Audit Login GDR Event,NTUserName

    exec sp_trace_setevent @traceidout,105,7,@on --Audit Login GDR Event,NTDomainName

    exec sp_trace_setevent @traceidout,105,8,@on --Audit Login GDR Event,HostName

    exec sp_trace_setevent @traceidout,105,9,@on --Audit Login GDR Event,ClientProcessID

    exec sp_trace_setevent @traceidout,105,43,@on --Audit Login GDR Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,105,49,@on --Audit Login GDR Event,RequestID

    exec sp_trace_setevent @traceidout,105,50,@on --Audit Login GDR Event,XactSequence

    exec sp_trace_setevent @traceidout,105,51,@on --Audit Login GDR Event,EventSequence

    exec sp_trace_setevent @traceidout,105,60,@on --Audit Login GDR Event,IsSystem

    exec sp_trace_setevent @traceidout,105,64,@on --Audit Login GDR Event,SessionLoginName

    exec sp_trace_setevent @traceidout,105,26,@on --Audit Login GDR Event,ServerName

    exec sp_trace_setevent @traceidout,105,28,@on --Audit Login GDR Event,ObjectType

    exec sp_trace_setevent @traceidout,105,35,@on --Audit Login GDR Event,DatabaseName

    exec sp_trace_setevent @traceidout,105,40,@on --Audit Login GDR Event,DBUserName

    exec sp_trace_setevent @traceidout,105,41,@on --Audit Login GDR Event,LoginSid

    exec sp_trace_setevent @traceidout,105,42,@on --Audit Login GDR Event,TargetLoginName

    exec sp_trace_setevent @traceidout,105,10,@on --Audit Login GDR Event,ApplicationName

    exec sp_trace_setevent @traceidout,105,11,@on --Audit Login GDR Event,LoginName

    exec sp_trace_setevent @traceidout,105,12,@on --Audit Login GDR Event,SPID

    exec sp_trace_setevent @traceidout,105,14,@on --Audit Login GDR Event,StartTime

    exec sp_trace_setevent @traceidout,105,21,@on --Audit Login GDR Event,EventSubClass

    exec sp_trace_setevent @traceidout,105,23,@on --Audit Login GDR Event,Success

    exec sp_trace_setevent @traceidout,106,1,@on --Audit Login Change Property Event,TextData

    exec sp_trace_setevent @traceidout,106,3,@on --Audit Login Change Property Event,DatabaseID

    exec sp_trace_setevent @traceidout,106,4,@on --Audit Login Change Property Event,TransactionID

    exec sp_trace_setevent @traceidout,106,60,@on --Audit Login Change Property Event,IsSystem

    exec sp_trace_setevent @traceidout,106,64,@on --Audit Login Change Property Event,SessionLoginName

    exec sp_trace_setevent @traceidout,106,43,@on --Audit Login Change Property Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,106,49,@on --Audit Login Change Property Event,RequestID

    exec sp_trace_setevent @traceidout,106,50,@on --Audit Login Change Property Event,XactSequence

    exec sp_trace_setevent @traceidout,106,51,@on --Audit Login Change Property Event,EventSequence

    exec sp_trace_setevent @traceidout,106,34,@on --Audit Login Change Property Event,ObjectName

    exec sp_trace_setevent @traceidout,106,35,@on --Audit Login Change Property Event,DatabaseName

    exec sp_trace_setevent @traceidout,106,37,@on --Audit Login Change Property Event,OwnerName

    exec sp_trace_setevent @traceidout,106,40,@on --Audit Login Change Property Event,DBUserName

    exec sp_trace_setevent @traceidout,106,41,@on --Audit Login Change Property Event,LoginSid

    exec sp_trace_setevent @traceidout,106,42,@on --Audit Login Change Property Event,TargetLoginName

    exec sp_trace_setevent @traceidout,106,23,@on --Audit Login Change Property Event,Success

    exec sp_trace_setevent @traceidout,106,26,@on --Audit Login Change Property Event,ServerName

    exec sp_trace_setevent @traceidout,106,28,@on --Audit Login Change Property Event,ObjectType

    exec sp_trace_setevent @traceidout,106,29,@on --Audit Login Change Property Event,NestLevel

    exec sp_trace_setevent @traceidout,106,11,@on --Audit Login Change Property Event,LoginName

    exec sp_trace_setevent @traceidout,106,12,@on --Audit Login Change Property Event,SPID

    exec sp_trace_setevent @traceidout,106,14,@on --Audit Login Change Property Event,StartTime

    exec sp_trace_setevent @traceidout,106,21,@on --Audit Login Change Property Event,EventSubClass

    exec sp_trace_setevent @traceidout,106,5,@on --Audit Login Change Property Event,LineNumber

    exec sp_trace_setevent @traceidout,106,6,@on --Audit Login Change Property Event,NTUserName

    exec sp_trace_setevent @traceidout,106,7,@on --Audit Login Change Property Event,NTDomainName

    exec sp_trace_setevent @traceidout,106,8,@on --Audit Login Change Property Event,HostName

    exec sp_trace_setevent @traceidout,106,9,@on --Audit Login Change Property Event,ClientProcessID

    exec sp_trace_setevent @traceidout,106,10,@on --Audit Login Change Property Event,ApplicationName

    exec sp_trace_setevent @traceidout,108,1,@on --Audit Add Login to Server Role Event,TextData

    exec sp_trace_setevent @traceidout,108,3,@on --Audit Add Login to Server Role Event,DatabaseID

    exec sp_trace_setevent @traceidout,108,4,@on --Audit Add Login to Server Role Event,TransactionID

    exec sp_trace_setevent @traceidout,108,6,@on --Audit Add Login to Server Role Event,NTUserName

    exec sp_trace_setevent @traceidout,108,7,@on --Audit Add Login to Server Role Event,NTDomainName

    exec sp_trace_setevent @traceidout,108,8,@on --Audit Add Login to Server Role Event,HostName

    exec sp_trace_setevent @traceidout,108,49,@on --Audit Add Login to Server Role Event,RequestID

    exec sp_trace_setevent @traceidout,108,50,@on --Audit Add Login to Server Role Event,XactSequence

    exec sp_trace_setevent @traceidout,108,51,@on --Audit Add Login to Server Role Event,EventSequence

    exec sp_trace_setevent @traceidout,108,60,@on --Audit Add Login to Server Role Event,IsSystem

    exec sp_trace_setevent @traceidout,108,64,@on --Audit Add Login to Server Role Event,SessionLoginName

    exec sp_trace_setevent @traceidout,108,37,@on --Audit Add Login to Server Role Event,OwnerName

    exec sp_trace_setevent @traceidout,108,38,@on --Audit Add Login to Server Role Event,RoleName

    exec sp_trace_setevent @traceidout,108,40,@on --Audit Add Login to Server Role Event,DBUserName

    exec sp_trace_setevent @traceidout,108,41,@on --Audit Add Login to Server Role Event,LoginSid

    exec sp_trace_setevent @traceidout,108,42,@on --Audit Add Login to Server Role Event,TargetLoginName

    exec sp_trace_setevent @traceidout,108,43,@on --Audit Add Login to Server Role Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,108,23,@on --Audit Add Login to Server Role Event,Success

    exec sp_trace_setevent @traceidout,108,26,@on --Audit Add Login to Server Role Event,ServerName

    exec sp_trace_setevent @traceidout,108,28,@on --Audit Add Login to Server Role Event,ObjectType

    exec sp_trace_setevent @traceidout,108,29,@on --Audit Add Login to Server Role Event,NestLevel

    exec sp_trace_setevent @traceidout,108,34,@on --Audit Add Login to Server Role Event,ObjectName

    exec sp_trace_setevent @traceidout,108,35,@on --Audit Add Login to Server Role Event,DatabaseName

    exec sp_trace_setevent @traceidout,108,9,@on --Audit Add Login to Server Role Event,ClientProcessID

    exec sp_trace_setevent @traceidout,108,10,@on --Audit Add Login to Server Role Event,ApplicationName

    exec sp_trace_setevent @traceidout,108,11,@on --Audit Add Login to Server Role Event,LoginName

    exec sp_trace_setevent @traceidout,108,12,@on --Audit Add Login to Server Role Event,SPID

    exec sp_trace_setevent @traceidout,108,14,@on --Audit Add Login to Server Role Event,StartTime

    exec sp_trace_setevent @traceidout,108,21,@on --Audit Add Login to Server Role Event,EventSubClass

    exec sp_trace_setevent @traceidout,109,3,@on --Audit Add DB User Event,DatabaseID

    exec sp_trace_setevent @traceidout,109,4,@on --Audit Add DB User Event,TransactionID

    exec sp_trace_setevent @traceidout,109,6,@on --Audit Add DB User Event,NTUserName

    exec sp_trace_setevent @traceidout,109,7,@on --Audit Add DB User Event,NTDomainName

    exec sp_trace_setevent @traceidout,109,8,@on --Audit Add DB User Event,HostName

    exec sp_trace_setevent @traceidout,109,9,@on --Audit Add DB User Event,ClientProcessID

    exec sp_trace_setevent @traceidout,109,49,@on --Audit Add DB User Event,RequestID

    exec sp_trace_setevent @traceidout,109,50,@on --Audit Add DB User Event,XactSequence

    exec sp_trace_setevent @traceidout,109,51,@on --Audit Add DB User Event,EventSequence

    exec sp_trace_setevent @traceidout,109,60,@on --Audit Add DB User Event,IsSystem

    exec sp_trace_setevent @traceidout,109,64,@on --Audit Add DB User Event,SessionLoginName

    exec sp_trace_setevent @traceidout,109,39,@on --Audit Add DB User Event,TargetUserName

    exec sp_trace_setevent @traceidout,109,40,@on --Audit Add DB User Event,DBUserName

    exec sp_trace_setevent @traceidout,109,41,@on --Audit Add DB User Event,LoginSid

    exec sp_trace_setevent @traceidout,109,42,@on --Audit Add DB User Event,TargetLoginName

    exec sp_trace_setevent @traceidout,109,43,@on --Audit Add DB User Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,109,44,@on --Audit Add DB User Event,ColumnPermissions

    exec sp_trace_setevent @traceidout,109,26,@on --Audit Add DB User Event,ServerName

    exec sp_trace_setevent @traceidout,109,28,@on --Audit Add DB User Event,ObjectType

    exec sp_trace_setevent @traceidout,109,29,@on --Audit Add DB User Event,NestLevel

    exec sp_trace_setevent @traceidout,109,35,@on --Audit Add DB User Event,DatabaseName

    exec sp_trace_setevent @traceidout,109,37,@on --Audit Add DB User Event,OwnerName

    exec sp_trace_setevent @traceidout,109,38,@on --Audit Add DB User Event,RoleName

    exec sp_trace_setevent @traceidout,109,10,@on --Audit Add DB User Event,ApplicationName

    exec sp_trace_setevent @traceidout,109,11,@on --Audit Add DB User Event,LoginName

    exec sp_trace_setevent @traceidout,109,12,@on --Audit Add DB User Event,SPID

    exec sp_trace_setevent @traceidout,109,14,@on --Audit Add DB User Event,StartTime

    exec sp_trace_setevent @traceidout,109,21,@on --Audit Add DB User Event,EventSubClass

    exec sp_trace_setevent @traceidout,109,23,@on --Audit Add DB User Event,Success

    exec sp_trace_setevent @traceidout,110,1,@on --Audit Add Member to DB Role Event,TextData

    exec sp_trace_setevent @traceidout,110,3,@on --Audit Add Member to DB Role Event,DatabaseID

    exec sp_trace_setevent @traceidout,110,4,@on --Audit Add Member to DB Role Event,TransactionID

    exec sp_trace_setevent @traceidout,110,6,@on --Audit Add Member to DB Role Event,NTUserName

    exec sp_trace_setevent @traceidout,110,7,@on --Audit Add Member to DB Role Event,NTDomainName

    exec sp_trace_setevent @traceidout,110,8,@on --Audit Add Member to DB Role Event,HostName

    exec sp_trace_setevent @traceidout,110,43,@on --Audit Add Member to DB Role Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,110,49,@on --Audit Add Member to DB Role Event,RequestID

    exec sp_trace_setevent @traceidout,110,50,@on --Audit Add Member to DB Role Event,XactSequence

    exec sp_trace_setevent @traceidout,110,51,@on --Audit Add Member to DB Role Event,EventSequence

    exec sp_trace_setevent @traceidout,110,60,@on --Audit Add Member to DB Role Event,IsSystem

    exec sp_trace_setevent @traceidout,110,64,@on --Audit Add Member to DB Role Event,SessionLoginName

    exec sp_trace_setevent @traceidout,110,37,@on --Audit Add Member to DB Role Event,OwnerName

    exec sp_trace_setevent @traceidout,110,38,@on --Audit Add Member to DB Role Event,RoleName

    exec sp_trace_setevent @traceidout,110,39,@on --Audit Add Member to DB Role Event,TargetUserName

    exec sp_trace_setevent @traceidout,110,40,@on --Audit Add Member to DB Role Event,DBUserName

    exec sp_trace_setevent @traceidout,110,41,@on --Audit Add Member to DB Role Event,LoginSid

    exec sp_trace_setevent @traceidout,110,42,@on --Audit Add Member to DB Role Event,TargetLoginName

    exec sp_trace_setevent @traceidout,110,23,@on --Audit Add Member to DB Role Event,Success

    exec sp_trace_setevent @traceidout,110,26,@on --Audit Add Member to DB Role Event,ServerName

    exec sp_trace_setevent @traceidout,110,28,@on --Audit Add Member to DB Role Event,ObjectType

    exec sp_trace_setevent @traceidout,110,29,@on --Audit Add Member to DB Role Event,NestLevel

    exec sp_trace_setevent @traceidout,110,34,@on --Audit Add Member to DB Role Event,ObjectName

    exec sp_trace_setevent @traceidout,110,35,@on --Audit Add Member to DB Role Event,DatabaseName

    exec sp_trace_setevent @traceidout,110,9,@on --Audit Add Member to DB Role Event,ClientProcessID

    exec sp_trace_setevent @traceidout,110,10,@on --Audit Add Member to DB Role Event,ApplicationName

    exec sp_trace_setevent @traceidout,110,11,@on --Audit Add Member to DB Role Event,LoginName

    exec sp_trace_setevent @traceidout,110,12,@on --Audit Add Member to DB Role Event,SPID

    exec sp_trace_setevent @traceidout,110,14,@on --Audit Add Member to DB Role Event,StartTime

    exec sp_trace_setevent @traceidout,110,21,@on --Audit Add Member to DB Role Event,EventSubClass

    exec sp_trace_setevent @traceidout,111,3,@on --Audit Add Role Event,DatabaseID

    exec sp_trace_setevent @traceidout,111,4,@on --Audit Add Role Event,TransactionID

    exec sp_trace_setevent @traceidout,111,6,@on --Audit Add Role Event,NTUserName

    exec sp_trace_setevent @traceidout,111,7,@on --Audit Add Role Event,NTDomainName

    exec sp_trace_setevent @traceidout,111,8,@on --Audit Add Role Event,HostName

    exec sp_trace_setevent @traceidout,111,9,@on --Audit Add Role Event,ClientProcessID

    exec sp_trace_setevent @traceidout,111,41,@on --Audit Add Role Event,LoginSid

    exec sp_trace_setevent @traceidout,111,49,@on --Audit Add Role Event,RequestID

    exec sp_trace_setevent @traceidout,111,50,@on --Audit Add Role Event,XactSequence

    exec sp_trace_setevent @traceidout,111,51,@on --Audit Add Role Event,EventSequence

    exec sp_trace_setevent @traceidout,111,60,@on --Audit Add Role Event,IsSystem

    exec sp_trace_setevent @traceidout,111,64,@on --Audit Add Role Event,SessionLoginName

    exec sp_trace_setevent @traceidout,111,26,@on --Audit Add Role Event,ServerName

    exec sp_trace_setevent @traceidout,111,28,@on --Audit Add Role Event,ObjectType

    exec sp_trace_setevent @traceidout,111,29,@on --Audit Add Role Event,NestLevel

    exec sp_trace_setevent @traceidout,111,35,@on --Audit Add Role Event,DatabaseName

    exec sp_trace_setevent @traceidout,111,38,@on --Audit Add Role Event,RoleName

    exec sp_trace_setevent @traceidout,111,40,@on --Audit Add Role Event,DBUserName

    exec sp_trace_setevent @traceidout,111,10,@on --Audit Add Role Event,ApplicationName

    exec sp_trace_setevent @traceidout,111,11,@on --Audit Add Role Event,LoginName

    exec sp_trace_setevent @traceidout,111,12,@on --Audit Add Role Event,SPID

    exec sp_trace_setevent @traceidout,111,14,@on --Audit Add Role Event,StartTime

    exec sp_trace_setevent @traceidout,111,21,@on --Audit Add Role Event,EventSubClass

    exec sp_trace_setevent @traceidout,111,23,@on --Audit Add Role Event,Success

    exec sp_trace_setevent @traceidout,115,1,@on --Audit Backup/Restore Event,TextData

    exec sp_trace_setevent @traceidout,115,3,@on --Audit Backup/Restore Event,DatabaseID

    exec sp_trace_setevent @traceidout,115,4,@on --Audit Backup/Restore Event,TransactionID

    exec sp_trace_setevent @traceidout,115,5,@on --Audit Backup/Restore Event,LineNumber

    exec sp_trace_setevent @traceidout,115,6,@on --Audit Backup/Restore Event,NTUserName

    exec sp_trace_setevent @traceidout,115,7,@on --Audit Backup/Restore Event,NTDomainName

    exec sp_trace_setevent @traceidout,115,51,@on --Audit Backup/Restore Event,EventSequence

    exec sp_trace_setevent @traceidout,115,60,@on --Audit Backup/Restore Event,IsSystem

    exec sp_trace_setevent @traceidout,115,64,@on --Audit Backup/Restore Event,SessionLoginName

    exec sp_trace_setevent @traceidout,115,35,@on --Audit Backup/Restore Event,DatabaseName

    exec sp_trace_setevent @traceidout,115,37,@on --Audit Backup/Restore Event,OwnerName

    exec sp_trace_setevent @traceidout,115,40,@on --Audit Backup/Restore Event,DBUserName

    exec sp_trace_setevent @traceidout,115,41,@on --Audit Backup/Restore Event,LoginSid

    exec sp_trace_setevent @traceidout,115,49,@on --Audit Backup/Restore Event,RequestID

    exec sp_trace_setevent @traceidout,115,50,@on --Audit Backup/Restore Event,XactSequence

    exec sp_trace_setevent @traceidout,115,21,@on --Audit Backup/Restore Event,EventSubClass

    exec sp_trace_setevent @traceidout,115,23,@on --Audit Backup/Restore Event,Success

    exec sp_trace_setevent @traceidout,115,26,@on --Audit Backup/Restore Event,ServerName

    exec sp_trace_setevent @traceidout,115,28,@on --Audit Backup/Restore Event,ObjectType

    exec sp_trace_setevent @traceidout,115,29,@on --Audit Backup/Restore Event,NestLevel

    exec sp_trace_setevent @traceidout,115,34,@on --Audit Backup/Restore Event,ObjectName

    exec sp_trace_setevent @traceidout,115,8,@on --Audit Backup/Restore Event,HostName

    exec sp_trace_setevent @traceidout,115,9,@on --Audit Backup/Restore Event,ClientProcessID

    exec sp_trace_setevent @traceidout,115,10,@on --Audit Backup/Restore Event,ApplicationName

    exec sp_trace_setevent @traceidout,115,11,@on --Audit Backup/Restore Event,LoginName

    exec sp_trace_setevent @traceidout,115,12,@on --Audit Backup/Restore Event,SPID

    exec sp_trace_setevent @traceidout,115,14,@on --Audit Backup/Restore Event,StartTime

    exec sp_trace_setevent @traceidout,116,1,@on --Audit DBCC Event,TextData

    exec sp_trace_setevent @traceidout,116,3,@on --Audit DBCC Event,DatabaseID

    exec sp_trace_setevent @traceidout,116,4,@on --Audit DBCC Event,TransactionID

    exec sp_trace_setevent @traceidout,116,5,@on --Audit DBCC Event,LineNumber

    exec sp_trace_setevent @traceidout,116,6,@on --Audit DBCC Event,NTUserName

    exec sp_trace_setevent @traceidout,116,7,@on --Audit DBCC Event,NTDomainName

    exec sp_trace_setevent @traceidout,116,64,@on --Audit DBCC Event,SessionLoginName

    exec sp_trace_setevent @traceidout,116,41,@on --Audit DBCC Event,LoginSid

    exec sp_trace_setevent @traceidout,116,44,@on --Audit DBCC Event,ColumnPermissions

    exec sp_trace_setevent @traceidout,116,49,@on --Audit DBCC Event,RequestID

    exec sp_trace_setevent @traceidout,116,50,@on --Audit DBCC Event,XactSequence

    exec sp_trace_setevent @traceidout,116,51,@on --Audit DBCC Event,EventSequence

    exec sp_trace_setevent @traceidout,116,60,@on --Audit DBCC Event,IsSystem

    exec sp_trace_setevent @traceidout,116,23,@on --Audit DBCC Event,Success

    exec sp_trace_setevent @traceidout,116,26,@on --Audit DBCC Event,ServerName

    exec sp_trace_setevent @traceidout,116,29,@on --Audit DBCC Event,NestLevel

    exec sp_trace_setevent @traceidout,116,35,@on --Audit DBCC Event,DatabaseName

    exec sp_trace_setevent @traceidout,116,37,@on --Audit DBCC Event,OwnerName

    exec sp_trace_setevent @traceidout,116,40,@on --Audit DBCC Event,DBUserName

    exec sp_trace_setevent @traceidout,116,8,@on --Audit DBCC Event,HostName

    exec sp_trace_setevent @traceidout,116,9,@on --Audit DBCC Event,ClientProcessID

    exec sp_trace_setevent @traceidout,116,10,@on --Audit DBCC Event,ApplicationName

    exec sp_trace_setevent @traceidout,116,11,@on --Audit DBCC Event,LoginName

    exec sp_trace_setevent @traceidout,116,12,@on --Audit DBCC Event,SPID

    exec sp_trace_setevent @traceidout,116,14,@on --Audit DBCC Event,StartTime

    exec sp_trace_setevent @traceidout,117,1,@on --Audit Change Audit Event,TextData

    exec sp_trace_setevent @traceidout,117,3,@on --Audit Change Audit Event,DatabaseID

    exec sp_trace_setevent @traceidout,117,5,@on --Audit Change Audit Event,LineNumber

    exec sp_trace_setevent @traceidout,117,6,@on --Audit Change Audit Event,NTUserName

    exec sp_trace_setevent @traceidout,117,7,@on --Audit Change Audit Event,NTDomainName

    exec sp_trace_setevent @traceidout,117,8,@on --Audit Change Audit Event,HostName

    exec sp_trace_setevent @traceidout,117,64,@on --Audit Change Audit Event,SessionLoginName

    exec sp_trace_setevent @traceidout,117,41,@on --Audit Change Audit Event,LoginSid

    exec sp_trace_setevent @traceidout,117,44,@on --Audit Change Audit Event,ColumnPermissions

    exec sp_trace_setevent @traceidout,117,49,@on --Audit Change Audit Event,RequestID

    exec sp_trace_setevent @traceidout,117,50,@on --Audit Change Audit Event,XactSequence

    exec sp_trace_setevent @traceidout,117,51,@on --Audit Change Audit Event,EventSequence

    exec sp_trace_setevent @traceidout,117,60,@on --Audit Change Audit Event,IsSystem

    exec sp_trace_setevent @traceidout,117,23,@on --Audit Change Audit Event,Success

    exec sp_trace_setevent @traceidout,117,26,@on --Audit Change Audit Event,ServerName

    exec sp_trace_setevent @traceidout,117,29,@on --Audit Change Audit Event,NestLevel

    exec sp_trace_setevent @traceidout,117,35,@on --Audit Change Audit Event,DatabaseName

    exec sp_trace_setevent @traceidout,117,37,@on --Audit Change Audit Event,OwnerName

    exec sp_trace_setevent @traceidout,117,40,@on --Audit Change Audit Event,DBUserName

    exec sp_trace_setevent @traceidout,117,9,@on --Audit Change Audit Event,ClientProcessID

    exec sp_trace_setevent @traceidout,117,10,@on --Audit Change Audit Event,ApplicationName

    exec sp_trace_setevent @traceidout,117,11,@on --Audit Change Audit Event,LoginName

    exec sp_trace_setevent @traceidout,117,12,@on --Audit Change Audit Event,SPID

    exec sp_trace_setevent @traceidout,117,14,@on --Audit Change Audit Event,StartTime

    exec sp_trace_setevent @traceidout,117,21,@on --Audit Change Audit Event,EventSubClass

    exec sp_trace_setevent @traceidout,152,1,@on --Audit Change Database Owner,TextData

    exec sp_trace_setevent @traceidout,152,3,@on --Audit Change Database Owner,DatabaseID

    exec sp_trace_setevent @traceidout,152,4,@on --Audit Change Database Owner,TransactionID

    exec sp_trace_setevent @traceidout,152,6,@on --Audit Change Database Owner,NTUserName

    exec sp_trace_setevent @traceidout,152,7,@on --Audit Change Database Owner,NTDomainName

    exec sp_trace_setevent @traceidout,152,8,@on --Audit Change Database Owner,HostName

    exec sp_trace_setevent @traceidout,152,50,@on --Audit Change Database Owner,XactSequence

    exec sp_trace_setevent @traceidout,152,51,@on --Audit Change Database Owner,EventSequence

    exec sp_trace_setevent @traceidout,152,60,@on --Audit Change Database Owner,IsSystem

    exec sp_trace_setevent @traceidout,152,64,@on --Audit Change Database Owner,SessionLoginName

    exec sp_trace_setevent @traceidout,152,39,@on --Audit Change Database Owner,TargetUserName

    exec sp_trace_setevent @traceidout,152,40,@on --Audit Change Database Owner,DBUserName

    exec sp_trace_setevent @traceidout,152,41,@on --Audit Change Database Owner,LoginSid

    exec sp_trace_setevent @traceidout,152,42,@on --Audit Change Database Owner,TargetLoginName

    exec sp_trace_setevent @traceidout,152,43,@on --Audit Change Database Owner,TargetLoginSid

    exec sp_trace_setevent @traceidout,152,49,@on --Audit Change Database Owner,RequestID

    exec sp_trace_setevent @traceidout,152,26,@on --Audit Change Database Owner,ServerName

    exec sp_trace_setevent @traceidout,152,28,@on --Audit Change Database Owner,ObjectType

    exec sp_trace_setevent @traceidout,152,29,@on --Audit Change Database Owner,NestLevel

    exec sp_trace_setevent @traceidout,152,34,@on --Audit Change Database Owner,ObjectName

    exec sp_trace_setevent @traceidout,152,35,@on --Audit Change Database Owner,DatabaseName

    exec sp_trace_setevent @traceidout,152,37,@on --Audit Change Database Owner,OwnerName

    exec sp_trace_setevent @traceidout,152,9,@on --Audit Change Database Owner,ClientProcessID

    exec sp_trace_setevent @traceidout,152,10,@on --Audit Change Database Owner,ApplicationName

    exec sp_trace_setevent @traceidout,152,11,@on --Audit Change Database Owner,LoginName

    exec sp_trace_setevent @traceidout,152,12,@on --Audit Change Database Owner,SPID

    exec sp_trace_setevent @traceidout,152,14,@on --Audit Change Database Owner,StartTime

    exec sp_trace_setevent @traceidout,152,23,@on --Audit Change Database Owner,Success

    exec sp_trace_setevent @traceidout,153,1,@on --Audit Schema Object Take Ownership Event,TextData

    exec sp_trace_setevent @traceidout,153,3,@on --Audit Schema Object Take Ownership Event,DatabaseID

    exec sp_trace_setevent @traceidout,153,4,@on --Audit Schema Object Take Ownership Event,TransactionID

    exec sp_trace_setevent @traceidout,153,6,@on --Audit Schema Object Take Ownership Event,NTUserName

    exec sp_trace_setevent @traceidout,153,7,@on --Audit Schema Object Take Ownership Event,NTDomainName

    exec sp_trace_setevent @traceidout,153,8,@on --Audit Schema Object Take Ownership Event,HostName

    exec sp_trace_setevent @traceidout,153,51,@on --Audit Schema Object Take Ownership Event,EventSequence

    exec sp_trace_setevent @traceidout,153,59,@on --Audit Schema Object Take Ownership Event,ParentName

    exec sp_trace_setevent @traceidout,153,60,@on --Audit Schema Object Take Ownership Event,IsSystem

    exec sp_trace_setevent @traceidout,153,64,@on --Audit Schema Object Take Ownership Event,SessionLoginName

    exec sp_trace_setevent @traceidout,153,40,@on --Audit Schema Object Take Ownership Event,DBUserName

    exec sp_trace_setevent @traceidout,153,41,@on --Audit Schema Object Take Ownership Event,LoginSid

    exec sp_trace_setevent @traceidout,153,42,@on --Audit Schema Object Take Ownership Event,TargetLoginName

    exec sp_trace_setevent @traceidout,153,43,@on --Audit Schema Object Take Ownership Event,TargetLoginSid

    exec sp_trace_setevent @traceidout,153,49,@on --Audit Schema Object Take Ownership Event,RequestID

    exec sp_trace_setevent @traceidout,153,50,@on --Audit Schema Object Take Ownership Event,XactSequence

    exec sp_trace_setevent @traceidout,153,28,@on --Audit Schema Object Take Ownership Event,ObjectType

    exec sp_trace_setevent @traceidout,153,29,@on --Audit Schema Object Take Ownership Event,NestLevel

    exec sp_trace_setevent @traceidout,153,34,@on --Audit Schema Object Take Ownership Event,ObjectName

    exec sp_trace_setevent @traceidout,153,35,@on --Audit Schema Object Take Ownership Event,DatabaseName

    exec sp_trace_setevent @traceidout,153,37,@on --Audit Schema Object Take Ownership Event,OwnerName

    exec sp_trace_setevent @traceidout,153,39,@on --Audit Schema Object Take Ownership Event,TargetUserName

    exec sp_trace_setevent @traceidout,153,10,@on --Audit Schema Object Take Ownership Event,ApplicationName

    exec sp_trace_setevent @traceidout,153,11,@on --Audit Schema Object Take Ownership Event,LoginName

    exec sp_trace_setevent @traceidout,153,12,@on --Audit Schema Object Take Ownership Event,SPID

    exec sp_trace_setevent @traceidout,153,14,@on --Audit Schema Object Take Ownership Event,StartTime

    exec sp_trace_setevent @traceidout,153,23,@on --Audit Schema Object Take Ownership Event,Success

    exec sp_trace_setevent @traceidout,153,26,@on --Audit Schema Object Take Ownership Event,ServerName

    exec sp_trace_setevent @traceidout,155,1,@on --FT:Crawl Started,TextData

    exec sp_trace_setevent @traceidout,155,3,@on --FT:Crawl Started,DatabaseID

    exec sp_trace_setevent @traceidout,155,4,@on --FT:Crawl Started,TransactionID

    exec sp_trace_setevent @traceidout,155,64,@on --FT:Crawl Started,SessionLoginName

    exec sp_trace_setevent @traceidout,155,51,@on --FT:Crawl Started,EventSequence

    exec sp_trace_setevent @traceidout,155,60,@on --FT:Crawl Started,IsSystem

    exec sp_trace_setevent @traceidout,155,22,@on --FT:Crawl Started,ObjectID

    exec sp_trace_setevent @traceidout,155,26,@on --FT:Crawl Started,ServerName

    exec sp_trace_setevent @traceidout,155,12,@on --FT:Crawl Started,SPID

    exec sp_trace_setevent @traceidout,155,14,@on --FT:Crawl Started,StartTime

    exec sp_trace_setevent @traceidout,156,3,@on --FT:Crawl Stopped,DatabaseID

    exec sp_trace_setevent @traceidout,156,4,@on --FT:Crawl Stopped,TransactionID

    exec sp_trace_setevent @traceidout,156,12,@on --FT:Crawl Stopped,SPID

    exec sp_trace_setevent @traceidout,156,14,@on --FT:Crawl Stopped,StartTime

    exec sp_trace_setevent @traceidout,156,22,@on --FT:Crawl Stopped,ObjectID

    exec sp_trace_setevent @traceidout,156,26,@on --FT:Crawl Stopped,ServerName

    exec sp_trace_setevent @traceidout,156,51,@on --FT:Crawl Stopped,EventSequence

    exec sp_trace_setevent @traceidout,156,60,@on --FT:Crawl Stopped,IsSystem

    exec sp_trace_setevent @traceidout,156,64,@on --FT:Crawl Stopped,SessionLoginName

    exec sp_trace_setevent @traceidout,157,3,@on --FT:Crawl Aborted,DatabaseID

    exec sp_trace_setevent @traceidout,157,4,@on --FT:Crawl Aborted,TransactionID

    exec sp_trace_setevent @traceidout,157,12,@on --FT:Crawl Aborted,SPID

    exec sp_trace_setevent @traceidout,157,14,@on --FT:Crawl Aborted,StartTime

    exec sp_trace_setevent @traceidout,157,22,@on --FT:Crawl Aborted,ObjectID

    exec sp_trace_setevent @traceidout,157,26,@on --FT:Crawl Aborted,ServerName

    exec sp_trace_setevent @traceidout,157,30,@on --FT:Crawl Aborted,State

    exec sp_trace_setevent @traceidout,157,31,@on --FT:Crawl Aborted,Error

    exec sp_trace_setevent @traceidout,157,51,@on --FT:Crawl Aborted,EventSequence

    exec sp_trace_setevent @traceidout,157,60,@on --FT:Crawl Aborted,IsSystem

    exec sp_trace_setevent @traceidout,157,64,@on --FT:Crawl Aborted,SessionLoginName

    exec sp_trace_setevent @traceidout,164,3,@on --Object:Altered,DatabaseID

    exec sp_trace_setevent @traceidout,164,4,@on --Object:Altered,TransactionID

    exec sp_trace_setevent @traceidout,164,6,@on --Object:Altered,NTUserName

    exec sp_trace_setevent @traceidout,164,7,@on --Object:Altered,NTDomainName

    exec sp_trace_setevent @traceidout,164,8,@on --Object:Altered,HostName

    exec sp_trace_setevent @traceidout,164,9,@on --Object:Altered,ClientProcessID

    exec sp_trace_setevent @traceidout,164,60,@on --Object:Altered,IsSystem

    exec sp_trace_setevent @traceidout,164,64,@on --Object:Altered,SessionLoginName

    exec sp_trace_setevent @traceidout,164,66,@on --Object:Altered,GroupID

    exec sp_trace_setevent @traceidout,164,41,@on --Object:Altered,LoginSid

    exec sp_trace_setevent @traceidout,164,49,@on --Object:Altered,RequestID

    exec sp_trace_setevent @traceidout,164,50,@on --Object:Altered,XactSequence

    exec sp_trace_setevent @traceidout,164,51,@on --Object:Altered,EventSequence

    exec sp_trace_setevent @traceidout,164,52,@on --Object:Altered,BigintData1

    exec sp_trace_setevent @traceidout,164,56,@on --Object:Altered,ObjectID2

    exec sp_trace_setevent @traceidout,164,24,@on --Object:Altered,IndexID

    exec sp_trace_setevent @traceidout,164,25,@on --Object:Altered,IntegerData

    exec sp_trace_setevent @traceidout,164,26,@on --Object:Altered,ServerName

    exec sp_trace_setevent @traceidout,164,28,@on --Object:Altered,ObjectType

    exec sp_trace_setevent @traceidout,164,34,@on --Object:Altered,ObjectName

    exec sp_trace_setevent @traceidout,164,35,@on --Object:Altered,DatabaseName

    exec sp_trace_setevent @traceidout,164,10,@on --Object:Altered,ApplicationName

    exec sp_trace_setevent @traceidout,164,11,@on --Object:Altered,LoginName

    exec sp_trace_setevent @traceidout,164,12,@on --Object:Altered,SPID

    exec sp_trace_setevent @traceidout,164,14,@on --Object:Altered,StartTime

    exec sp_trace_setevent @traceidout,164,21,@on --Object:Altered,EventSubClass

    exec sp_trace_setevent @traceidout,164,22,@on --Object:Altered,ObjectID

    exec sp_trace_setevent @traceidout,167,1,@on --Database Mirroring State Change,TextData

    exec sp_trace_setevent @traceidout,167,3,@on --Database Mirroring State Change,DatabaseID

    exec sp_trace_setevent @traceidout,167,4,@on --Database Mirroring State Change,TransactionID

    exec sp_trace_setevent @traceidout,167,12,@on --Database Mirroring State Change,SPID

    exec sp_trace_setevent @traceidout,167,14,@on --Database Mirroring State Change,StartTime

    exec sp_trace_setevent @traceidout,167,25,@on --Database Mirroring State Change,IntegerData

    exec sp_trace_setevent @traceidout,167,60,@on --Database Mirroring State Change,IsSystem

    exec sp_trace_setevent @traceidout,167,64,@on --Database Mirroring State Change,SessionLoginName

    exec sp_trace_setevent @traceidout,167,26,@on --Database Mirroring State Change,ServerName

    exec sp_trace_setevent @traceidout,167,30,@on --Database Mirroring State Change,State

    exec sp_trace_setevent @traceidout,167,35,@on --Database Mirroring State Change,DatabaseName

    exec sp_trace_setevent @traceidout,167,41,@on --Database Mirroring State Change,LoginSid

    exec sp_trace_setevent @traceidout,167,49,@on --Database Mirroring State Change,RequestID

    exec sp_trace_setevent @traceidout,167,51,@on --Database Mirroring State Change,EventSequence

    exec sp_trace_setevent @traceidout,175,1,@on --Audit Server Alter Trace Event,TextData

    exec sp_trace_setevent @traceidout,175,3,@on --Audit Server Alter Trace Event,DatabaseID

    exec sp_trace_setevent @traceidout,175,4,@on --Audit Server Alter Trace Event,TransactionID

    exec sp_trace_setevent @traceidout,175,6,@on --Audit Server Alter Trace Event,NTUserName

    exec sp_trace_setevent @traceidout,175,7,@on --Audit Server Alter Trace Event,NTDomainName

    exec sp_trace_setevent @traceidout,175,8,@on --Audit Server Alter Trace Event,HostName

    exec sp_trace_setevent @traceidout,175,41,@on --Audit Server Alter Trace Event,LoginSid

    exec sp_trace_setevent @traceidout,175,49,@on --Audit Server Alter Trace Event,RequestID

    exec sp_trace_setevent @traceidout,175,50,@on --Audit Server Alter Trace Event,XactSequence

    exec sp_trace_setevent @traceidout,175,51,@on --Audit Server Alter Trace Event,EventSequence

    exec sp_trace_setevent @traceidout,175,60,@on --Audit Server Alter Trace Event,IsSystem

    exec sp_trace_setevent @traceidout,175,64,@on --Audit Server Alter Trace Event,SessionLoginName

    exec sp_trace_setevent @traceidout,175,28,@on --Audit Server Alter Trace Event,ObjectType

    exec sp_trace_setevent @traceidout,175,29,@on --Audit Server Alter Trace Event,NestLevel

    exec sp_trace_setevent @traceidout,175,34,@on --Audit Server Alter Trace Event,ObjectName

    exec sp_trace_setevent @traceidout,175,35,@on --Audit Server Alter Trace Event,DatabaseName

    exec sp_trace_setevent @traceidout,175,37,@on --Audit Server Alter Trace Event,OwnerName

    exec sp_trace_setevent @traceidout,175,40,@on --Audit Server Alter Trace Event,DBUserName

    exec sp_trace_setevent @traceidout,175,10,@on --Audit Server Alter Trace Event,ApplicationName

    exec sp_trace_setevent @traceidout,175,11,@on --Audit Server Alter Trace Event,LoginName

    exec sp_trace_setevent @traceidout,175,12,@on --Audit Server Alter Trace Event,SPID

    exec sp_trace_setevent @traceidout,175,14,@on --Audit Server Alter Trace Event,StartTime

    exec sp_trace_setevent @traceidout,175,23,@on --Audit Server Alter Trace Event,Success

    exec sp_trace_setevent @traceidout,175,26,@on --Audit Server Alter Trace Event,ServerName

    exec sp_trace_setevent @traceidout,218,1,@on --Plan Guide Unsuccessful,TextData

    exec sp_trace_setevent @traceidout,218,3,@on --Plan Guide Unsuccessful,DatabaseID

    exec sp_trace_setevent @traceidout,218,4,@on --Plan Guide Unsuccessful,TransactionID

    exec sp_trace_setevent @traceidout,218,6,@on --Plan Guide Unsuccessful,NTUserName

    exec sp_trace_setevent @traceidout,218,7,@on --Plan Guide Unsuccessful,NTDomainName

    exec sp_trace_setevent @traceidout,218,8,@on --Plan Guide Unsuccessful,HostName

    exec sp_trace_setevent @traceidout,218,60,@on --Plan Guide Unsuccessful,IsSystem

    exec sp_trace_setevent @traceidout,218,64,@on --Plan Guide Unsuccessful,SessionLoginName

    exec sp_trace_setevent @traceidout,218,26,@on --Plan Guide Unsuccessful,ServerName

    exec sp_trace_setevent @traceidout,218,35,@on --Plan Guide Unsuccessful,DatabaseName

    exec sp_trace_setevent @traceidout,218,41,@on --Plan Guide Unsuccessful,LoginSid

    exec sp_trace_setevent @traceidout,218,49,@on --Plan Guide Unsuccessful,RequestID

    exec sp_trace_setevent @traceidout,218,50,@on --Plan Guide Unsuccessful,XactSequence

    exec sp_trace_setevent @traceidout,218,51,@on --Plan Guide Unsuccessful,EventSequence

    exec sp_trace_setevent @traceidout,218,9,@on --Plan Guide Unsuccessful,ClientProcessID

    exec sp_trace_setevent @traceidout,218,10,@on --Plan Guide Unsuccessful,ApplicationName

    exec sp_trace_setevent @traceidout,218,11,@on --Plan Guide Unsuccessful,LoginName

    exec sp_trace_setevent @traceidout,218,12,@on --Plan Guide Unsuccessful,SPID

    exec sp_trace_setevent @traceidout,218,14,@on --Plan Guide Unsuccessful,StartTime

    exec sp_trace_setevent @traceidout,218,22,@on --Plan Guide Unsuccessful,ObjectID

    --filters

    exec sp_trace_setfilter @traceidout,1,0,6, N'UPDATE%' -- AND TextData LIKE UPDATE%

    exec sp_trace_setfilter @traceidout,1,1,6, N'INSERT%' -- OR TextData LIKE INSERT%

    exec sp_trace_setfilter @traceidout,1,1,6, N'DELETE%' -- OR TextData LIKE DELETE%

    exec sp_trace_setfilter @traceidout,3,0,0, N'60' -- AND DatabaseID = 60

    exec sp_trace_setfilter @traceidout,10,0,7, N'SQL Server Profiler - 993c4f6b-7e4c-4129-818d-74f0011712f9' -- AND ApplicationName NOT LIKE SQL Server Profiler - 993c4f6b-7e4c-4129-818d-74f0011712f9

    exec sp_trace_setfilter @traceidout,11,0,6, N'\%' -- AND LoginName LIKE \%

    exec sp_trace_setfilter @traceidout,35,0,6, N'Customer' -- AND DatabaseName LIKE Customer

    ---final step

    --turn on the trace

    exec sp_trace_setstatus @traceidout, 1 ---start trace

    --exec sp_trace_setstatus TRACEID, 0 ---stop trace, you must know the traceid to stop it

    --exec sp_trace_setstatus TRACEID, 2 ---close trace you must know the traceid to delete it

    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!

  • Actually that was it. I had the wrong db id in there.

    Thanks so much. I totally forgot about that parameter.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply