TraceServer Class

The TraceServer class is a Trace object that represents a new trace on an instance of SQL Server.

Inheritance Hierarchy

System.Object
  Microsoft.SqlServer.Management.Trace.TraceReader
    Microsoft.SqlServer.Management.Trace.TraceServer

Namespace:  Microsoft.SqlServer.Management.Trace
Assembly:  Microsoft.SqlServer.ConnectionInfoExtended (in Microsoft.SqlServer.ConnectionInfoExtended.dll)

Syntax

'Declaration
<ComVisibleAttribute(False)> _
Public Class TraceServer _
    Inherits TraceReader
'Usage
Dim instance As TraceServer
[ComVisibleAttribute(false)]
public class TraceServer : TraceReader
[ComVisibleAttribute(false)]
public ref class TraceServer : public TraceReader
[<ComVisibleAttribute(false)>]
type TraceServer =  
    class 
        inherit TraceReader 
    end
public class TraceServer extends TraceReader

The TraceServer type exposes the following members.

Constructors

  Name Description
Public method TraceServer Initializes a new instance of the TraceServer class.

Top

Properties

  Name Description
Public property Depth Gets the depth value for the trace reader. (Inherited from TraceReader.)
Public property FieldCount Gets the number of columns in the data. (Inherited from TraceReader.)
Public property IsClosed Gets the Boolean property value that specifies whether the trace reader is closed. (Inherited from TraceReader.)
Public property Item[Int32] Gets the column specified by the index position. (Inherited from TraceReader.)
Public property Item[String] Gets the column with the specified name. (Inherited from TraceReader.)
Public property RecordsAffected Gets the number of records of data. (Inherited from TraceReader.)

Top

Methods

  Name Description
Public method Close Closes the trace reader. (Inherited from TraceReader.)
Public method Dispose Deletes the trace reader information. (Inherited from TraceReader.)
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetBoolean Returns a Boolean value from the record at the specified column position. (Inherited from TraceReader.)
Public method GetByte Returns a Byte value from the record at the specified column position. (Inherited from TraceReader.)
Public method GetBytes Gets a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset. (Inherited from TraceReader.)
Public method GetChar Gets a character value of the specified column. (Inherited from TraceReader.)
Public method GetChars(Int32, array<Char[], Int32, Int32, Int32) Gets a character array value from the record at the specified column position. (Inherited from TraceReader.)
Public method GetChars(Int32, Int64, array<Char[], Int32, Int32) Gets a character array value from the record at the specified column position. (Inherited from TraceReader.)
Public method GetData Returns IDataReader object used when the field points to a remote data structure. (Inherited from TraceReader.)
Public method GetDataTypeName Gets the data type of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetDateTime Gets a DateTime value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetDecimal Gets a Decimal value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetDouble Gets a floating point value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetFieldType Returns the field type of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetFloat Gets a floating point value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetGuid Gets a Guid system value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetHashCode (Inherited from Object.)
Public method GetInt16 Gets a small integer value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetInt32 Gets an integer value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetInt64 Gets a long integer value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetName Gets the name of the field at the specified column position. (Inherited from TraceReader.)
Public method GetOrdinal Gets the ordinal value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetSchemaTable Gets a table that describes the schema. (Inherited from TraceReader.)
Public method GetStream Gets the stream of data. (Inherited from TraceReader.)
Public method GetString Gets a String value at the specified column position. (Inherited from TraceReader.)
Public method GetTimeSpan Gets a TimeSpan value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetType (Inherited from Object.)
Public method GetValue Gets a value of the data value at the specified column position. (Inherited from TraceReader.)
Public method GetValues Gets an array of values from the data value at the specified column position. (Inherited from TraceReader.)
Public method InitializeAsReader Initializes the server as a trace reader.
Public method IsDBNull Specifies whether the specified column is set to null. (Inherited from TraceReader.)
Public method IsNull Gets a Boolean value that specifies whether value of the data at the specified column position is null. (Inherited from TraceReader.)
Protected method MemberwiseClone (Inherited from Object.)
Public method NextResult Moves to the next result in the trace. (Inherited from TraceReader.)
Public method Pause Pauses the trace.
Public method Read Reads the trace record. (Inherited from TraceReader.)
Public method Restart Restarts the trace.
Public method Stop Stops the trace.
Public method ToString (Inherited from Object.)
Public method TranslateSubclass Translates the sub class. (Inherited from TraceReader.)

Top

Fields

  Name Description
Protected field currentRow Specifies the current row. (Inherited from TraceReader.)

Top

Remarks

With the TraceServer object you can:

  • Start a new trace.

  • Read a trace.

In addition to the Trace and Replay objects, the trace can be created manually by using SQL Server Profiler Reference or by using a set of Transact-SQL stored procedures called Introducing SQL Trace.

Examples

Readme_Tracer

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SqlServer.Management.Trace Namespace

Other Resources

Trace Flags (Transact-SQL)

SQL Server Profiler Templates and Permissions