show_cached_text

Description

Displays the SQL text of a cached statement.

Syntax

show_cached_text(statement_id)

Parameters

statement_id

is the ID of the statement. Derived from the SSQLID column of monCachedStatement.

Examples

Example 1

Displays the contents of monCachedStatement, then uses the show_cached_text function to show the SQL text:

select InstanceID, SSQLID, Hashkey, UseCount, StmtType
from monCachedStatement
InstanceID  SSQLID     Hashkey      UseCount  StmtType
----------  ---------- ---------- ----------- --------
0           329111220  1108036110           0       2
0           345111277  1663781964           1       1

select show_cached_text(329111220)
--------------------------------------
select id from sysroles

Usage