Dynamic Control of TDS Protocol Capture

The new SQL_ATTR_TDS_CAPTURE connection attribute of Adaptive Server Enterprise ODBC Driver allows pause (SQL_CAPTURE_PAUSE) and resume (SQL_CAPTURE_RESUME) of TDS protocol capture.

// pause protocol capture
SQLSetConnAttr(hDBC, SQL_ATTR_TDS_CAPTURE,
   (SQLPOINTER) SQL_CAPTURE_PAUSE, SQLINTEGER);

// resume protocol capture
SQLSetConnAttr(hDBC, SQL_ATTR_TDS_CAPTURE,
   (SQLPOINTER) SQL_CAPTURE_RESUME, SQLINTEGER);

By default, TDS protocol capture operates for the duration of the connection when the ProtocolCapture connection property is set for the connection. Using SQL_ATTR_TDS_CAPTURE (with the ProtocolCapture connection property set) allows the application to selectively pause and resume TDS protocol capture for desired segments of program execution.

SQL_ATTR_TDS_CAPTURE can be set after a connection handle is allocated. It is not an error to pause or resume TDS protocol capture before a connection is established or for a connection that is not using TDS protocol capture. Pausing or resuming TDS protocol capture may be delayed by the driver to ensure the integrity of the capture stream. This ensures the write of full PDU packets for accurate capture consumption by Ribo and other protocol translator utilities.

Do not set SQL_ATTR_TDS_CAPTURE for applications that need to capture all TDS packets for a connection.