SQL Property in Simple Queries for Auditing

By Ricardo Camacho on 24 Aug 2010
It would be nice if the Simple Queries component had a runtime property with the EXECUTED SQL, including the Parameters used.
Fernando Sousa27 Aug 2010
Why not for advanced queries as well? If you have expand inline parameters, it will probably be very useful to get the SQL command as well.
J.27 Aug 2010

Why would that be interesting?

you can see them in the relevant manager (toad, sql-manager etc)

Ricardo Camacho27 Aug 2010
It streamlines debugging process speeding up your assessment of the situation.

It centralizes the required information in a single system without the use of external tools.

It provides a simple way for in mid-development printing it to the screen if needed and just checking it?

Take your pick. Each of the above speeds up my personal development process.

J.27 Aug 2010

and test-query isn't enough for your needs in that case?

easy and fast.

you can even copy the sql from the simple query to an advanced query to expand it more.

Fernando Sousa27 Aug 2010
I was considering this as something like the executed sql command being audited to general logs like the SLOWSQL and SLOWEXTENSION events.

This could be very helpful for support teams that may not have full knowledge how an application works and where is that query that is taking too much time...

Are you proposing a different scenario from the one I had in mind?
Ricardo Camacho30 Aug 2010
Actually I was considering exactly that Fernando. Logging the executed SQL query into service center through the audit component using a discloses property of the simple SQL widget that would contain the SQL query and its parameter values.
Diogo Cordeiro27 Aug 2011
Yes, please implement this....

So many times i have recurred to SQL Server Profiler, to find the executed query, in that unidented format (you you know of some other tool that gives you the executed query, nicely idented, please do share)

For simple queries : It is nice when these get astronomic sizes (for me, everything that has more than 5 conditions in a simple query makes me consider using the advanced query, just to read it in a nicer way), and you just can't find out where the problem is...

As for advanced queries, yes : extend properties's inputs are a reason, and regular inputs might be...
Other reason for this might as well be : trying to do test query behind a slow connection (for many multiple reasons), and expect thousands of records.

J.29 Aug 2011
On hindsight, I would love to see them sooner in the general log, error log.

But I agree with the Idea.