Note that I'm asking about DDL queries in particular. From the documentation, it's not clear how to do this or if this is even possible.
STL_DDLTEXT seems to only show finished DDL queries.
STV_RECENTS and STV_INFLIGHT don't document whether they show regular queries vs DDL; from experience I have never seen any DDL queries in those system views.
STV_RECENTS
does capture the currently active and recently run queries. The queries include both DDL and DML. I know this because I use it in my script.
If I've made a bad assumption please comment and I'll refocus my answer.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.