Running sp_opt_querystats

Log in to Adaptive Server using the login that has the js_user_role. Run sp_opt_querystats to analyze a query (the diagnostic information begins with the phrase [BEGIN QUERY ANALYSIS] and ends with [END QUERY ANALYSIS]).

The syntax is:

sp_opt_querystats "query_text" | help [, "diagnostic_options" | null 
[, database_name]]

For example:

sp_opt_querystats "select * from pubs2..authors where au_id = "172-32-1176"

See the Reference Manual: Procedures.