CapturedSql Class

The CapturedSql class represents the Transact-SQL commands that are sent to the instance of SQL Server by way of the referenced connection. However, they are then redirected to a buffer instead of running immediately on the instance of SQL Server.

Inheritance Hierarchy

System.Object
  Microsoft.SqlServer.Management.Common.CapturedSql

Namespace:  Microsoft.SqlServer.Management.Common
Assembly:  Microsoft.SqlServer.ConnectionInfo (in Microsoft.SqlServer.ConnectionInfo.dll)

Syntax

'Declaration
Public NotInheritable Class CapturedSql
'Usage
Dim instance As CapturedSql
public sealed class CapturedSql
public ref class CapturedSql sealed
[<SealedAttribute>]
type CapturedSql =  class end
public final class CapturedSql

The CapturedSql type exposes the following members.

Properties

  Name Description
Public property Text Gets the captured Transact-SQL commands in the buffer.

Top

Methods

  Name Description
Public method Add Adds a Transact-SQL statement to the captured Transact-SQL commands in the buffer.
Public method Clear Clears the buffer that contains the captured Transact-SQL commands.
Public method Equals (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method ToString (Inherited from Object.)

Top

Remarks

The capturedSql object is served by the connectionmanager object.

Thread Safety

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

Examples

Using Capture Mode

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.Common Namespace