ave4496
ave4496

Reputation: 3018

Executed SQL-Statement can't be viewed in SQL Server Profiler

When I execute SQL statements without parameters I can see them in the profiler but when I set a parameter it just displays as SELECT 1. Is there any explanation for this? Is there a switch where I can turn this feature on for parameters?

profiler table

Upvotes: 2

Views: 648

Answers (1)

Andrey Nikolov
Andrey Nikolov

Reputation: 13450

You could also capture SQL:StmtStarting, Prepare SQL, Exec Prepared SQL (in TSQL) and SP:stmtStarting, RPC:Starting (in Stored Procedures) events. With them you should capture all queries.

This SELECT 1 isn't related to your parameterized queries. If it isn't something that you sent, then the JDBC driver could be executing them to check the connection or something similar.

Upvotes: 2

Related Questions