Need sp_trace_setfilter xref list of @columnid parameters

  • Where in BOL can I find the cross-reference list of @columnID's used in the sp_trace_setfilter parameters.

    Please be specific as I've searched BOL and can't locate them.  Specifically, I want to filter on database ID w/in the sp_trace_setfilter statement.  (looks like 10=AppName  11=UserName in the following BOL example):

    BOL sp_trace_setfilter example:

    This example sets three filters on Trace 1. The filters N'SQLT%' and N'MS%' operate on one column (AppName, value 10) using the "LIKE" comparison operator. The filter N'joe' operates on a different column (UserName, value 11) using the "EQUAL" comparison operator.

    sp_trace_setfilter  1, 10, 0, 6, N'SQLT%'

    sp_trace_setfilter  1, 10, 0, 6, N'MS%'

    sp_trace_setfilter  1, 11, 0, 0, N'joe'

     

    BT
  • I found this XREF List: http://www.transactsql.com/html/sp_trace_setfilter.html

     

    BT
  • The link seems not to work, any alternative to the link above.

  • It is on the MS site but I already assembled:

    IDNameDescription
    1TextDataText value dependent on the event class that is captured in the trace.
    2BinaryDataBinary value dependent on the event class captured in the trace.
    3DatabaseIDID of the database specified by the USE database statement, or the default database if no USE database statement is issued for a given connection.
    4TransactionIDSystem-assigned ID of the transaction.
    6NTUserNameMicrosoft Windows NT® user name.
    7NTDomainNameWindows NT domain to which the user belongs.
    8ClientHostNameName of the client computer that originated the request.
    9ClientProcessIDID assigned by the client computer to the process in which the client application is running.
    10ApplicationNameName of the client application that created the connection to an instance of SQL Server. This column is populated with the values passed by the application rather than the displayed name of the program.
    11SQLSecurityLoginNameSQL Server login name of the client.
    12SPIDServer Process ID assigned by SQL Server to the process associated with the client.
    13DurationAmount of elapsed time (in milliseconds) taken by the event. This data column is not populated by the Hash Warning event.
    14StartTimeTime at which the event started, when available.
    15EndTimeTime at which the event ended. This column is not populated for starting event classes, such as SQL:BatchStarting or SP:Starting. It is also not populated by the Hash Warning event.
    16ReadsNumber of logical disk reads performed by the server on behalf of the event. This column is not populated by the Lock:Released event.
    17WritesNumber of physical disk writes performed by the server on behalf of the event.
    18CPUAmount of CPU time (in milliseconds) used by the event.
    19PermissionsRepresents the bitmap of permissions; used by Security Auditing.
    20SeveritySeverity level of an exception.
    21EventSubClassType of event subclass. This data column is not populated for all event classes.
    22ObjectIDSystem-assigned ID of the object.
    23SuccessSuccess of the permissions usage attempt; used for auditing.
    24IndexIDID for the index on the object affected by the event. To determine the index ID for an object, use the indid column of the sysindexes system table.
    25IntegerDataInteger value dependent on the event class captured in the trace.
    26ServerNameName of the instance of SQL Server (either servername or servername\instancename) being traced.
    27EventClassType of event class being recorded.
    28ObjectTypeType of object (such as table, function, or stored procedure).
    29NestLevelNest Level
    30StateServer state, in case of an error.
    31ErrorError number.
    32ModeLock mode of the lock acquired. This column is not populated by the Lock:Released event.
    33HandleHandle of the object referenced in the event.
    34ObjectNameName of object accessed.
    35DatabaseNameName of the database specified in the USE database statement.
    36FilenameLogical name of the file name modified.
    37ObjectOwnerOwner ID of the object referenced.
    38TargetRoleNameName of the database or server-wide role targeted by a statement.
    39TargetUserNameUser name of the target of some action.
    40DatabaseUserNameSQL Server database username of the client.
    41LoginSIDSecurity identification number (SID) of the logged-in user.
    42TargetLoginNameLogin name of the target of some action.
    43TargetLoginSIDSID of the login that is the target of some action.
    44ColumnPermissionsSetColumn-level permissions status; used by Security Auditing.

    SQL = Scarcely Qualifies as a Language

  • Here are the values for eventclass

    10RPC:Completed
    11RPC:Starting
    12SQL:BatchCompleted
    13SQL:BatchStarting
    14Login
    15Logout
    16Attention
    17ExistingConnection
    18ServiceControl
    19DTCTransaction
    20Login Failed
    21EventLog
    22ErrorLog
    23Lock:Released
    24Lock:Acquired
    25Lockeadlock
    26Lock:Cancel
    27Lock:Timeout
    28DOP Event
    33Exception
    34SP:CacheMiss
    35SP:CacheInsert
    36SP:CacheRemove
    37SP:Recompile
    38SP:CacheHit
    39SP:ExecContextHit
    40SQL:StmtStarting
    41SQL:StmtCompleted
    42SP:Starting
    43SP:Completed
    44SP:StmtStarting
    45SP:StmtCompleted
    46Object:Created
    47Objecteleted
    50SQL Transaction
    51Scan:Started
    52Scan:Stopped
    53CursorOpen
    54Transaction Log
    55Hash Warning
    58Auto Update Stats
    59Lockeadlock Chain
    60Lock:Escalation
    61OLE DB Errors
    67Execution Warnings
    68Execution Plan
    69Sort Warnings
    70CursorPrepare
    71Prepare SQL
    72Exec Prepared SQL
    73Unprepare SQL
    74CursorExecute
    75CursorRecompile
    76CursorImplicitConversion
    77CursorUnprepare
    78CursorClose
    79Missing Column Statistics
    80Missing Join Predicate
    81Server Memory Change
    92Data File Auto Grow
    93Log File Auto Grow
    94Data File Auto Shrink
    95Log File Auto Shrink
    96Show Plan Text
    97Show Plan ALL
    98Show Plan Statistics
    100RPC Output Parameter
    102Audit Statement GDR
    103Audit Object GDR
    104Audit Add/Drop Login
    105Audit Login GDR
    106Audit Login Change Property
    107Audit Login Change Password
    108Audit Add Login to Server Role
    109Audit Add DB User
    110Audit Add Member to DB Role
    111Audit Add/Drop Role
    112App Role Pass Change
    113Audit Statement Permission
    114Audit Object Permission
    115Audit Backup/Restore
    116Audit DBCC
    117Audit Change Audit
    118Audit Object Derived Permission

    SQL = Scarcely Qualifies as a Language

  • For column 22 ObjectType, here are the values:

    1Index
    2Database
    3User object
    4CHECK constraint
    5Default or DEFAULT constraint
    6FOREIGN KEY constraint
    7PRIMARY KEY constraint
    8Stored procedure
    9User-defined function (UDF)
    10Rule
    11Replication filter stored procedure
    12System table
    13Trigger
    14Inline function
    15Table valued UDF
    16UNIQUE constraint
    17User table
    18View
    19Extended stored procedure
    20Ad-hoc query
    21Prepared query
    22Statistics

    SQL = Scarcely Qualifies as a Language

  • Thanks

  • How would I code the sp_trace_setfilter statement to filter on DATABASE ID = 5  ??

    BT
  • This will place a filter aon the database id.

    declare @intfilter int

    set @intfilter = 5

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

    One tip, if your not sure about the paramters and values just define it in Profeiler and when use the option "Script Trace".

    Markus

    [font="Verdana"]Markus Bohse[/font]

  • THANK YOU! you guys are the best.

    FYI, thought i would mention, i DID use the scripting option (2005) and for some crazy reason, it DID NOT hold onto the database ID filter. it did not set it.

    so i came out here frantically looking for the "manual" way to do it.

    =)

  • Markus,

    I have noticed that when I script a trace, for some reason, it doesn't pick up all of the column filters.

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply