sql server - Can I check what T-SQL statement had been executed in the database? -


i have c# application, thing in database, black boxed, possible can check t-sql statements had been run on sql server? thanks.

profiler way go serge said keep query in pocket when can't approval enable profiler on production.

select top 50 deqs.last_execution_time [time], dest.text [query] sys.dm_exec_query_stats deqs cross apply sys.dm_exec_sql_text(deqs.sql_handle) dest order deqs.last_execution_time desc 

of course want modify top 50 show more or less results.

note: i've used such long time forgot didn't come myself. found on sqlauthority. credit credit due! :)


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -