Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server trace how to see the TSQL for prepared SQL

Tags:

sql

sql-server

When I run an SQL trace I want to see the TSQL statements that are executed. I chose all the TSQL events to show. For most like "SQL:StmtStarting" I can see the TSQL but for "Exec prepared SQL" the TextData is blank.

Any ideas? I want to see the query that will be executed.

TIA

like image 493
sproketboy Avatar asked Jan 30 '26 14:01

sproketboy


1 Answers

SQL:StmtStarting should give you the text of your TSQL every time. You should not even need any of the other options if all you want is to see the TSQL that will be executed? Are you saying that you are running TSQL queries and not seeing them with this option?

like image 167
Justin Pihony Avatar answered Feb 01 '26 11:02

Justin Pihony