View scripts ran by a specific user? I read in a stackoverflow post that you can restore scripts from the past 24 hours by using this query:

Use &lt;database&gt;
SELECT execquery.last_execution_time AS [Date Time], execsql.text AS [Script] FROM sys.dm_exec_query_stats AS execquery
CROSS APPLY sys.dm_exec_sql_text(execquery.sql_handle) AS execsql
ORDER BY execquery.last_execution_time DESC


But I want to see only queries which a specific user ran, how can I perform this?
In order to achieve it, you'll need to capture this information at run time using DMV's or Extended Events.