Use show_cached_text to view the SQL text of a cached statement. show_cached_text uses the statement ID as input and displays the text and parameter information of the corresponding statement.The syntax is:
select show_cached_text(SSQLID)
Use show_cached_text to obtain text for statements in the statement cache in queries. For example:
select SSQLID, show_cached_text(SSQLID) from master..monCachedStatement