I have alerting system based on million views
for better maintenance and to give the users the ability to see the SQL
I want to add query item with the sql behind the view
and then the user can see the SQL by "running" the query item"
is it possible?
The idea is that the model insulates the user from the SQL underneath. If the model is sound, then the SQL is sound and the results are sound.
Capturing the SQL behind a database view is certainly possible through traces. However,this is DBA territory, not user stuff.
At least on SQL server it is possible to write generated SQL to a database table and analyse the statements. A sure way to hog the the performance though..