I need following details:

  • Username of the user who initiated the transaction

  • Origin of the query i.e. Whether Query executed in SQL server New Query Interface or Transaction due to editing in Table or Via any other application.

I know that all the transactions are saved in .ldf file. Using sql query/other tools i was able to fetch some details but not all the above for all transactions. Is there any way to get all the above information for all transactions.


Use SQL Server Audit, after upgrading to a supported version of SQL Server. For SQL Server 2008 there's only SQL Trace. And in either case there's no way to get this information after the fact. You have to set something up to capture it.

  • ... in addition, there is no safe way to get which application did the modification. This is because it is the app itself that submits the app_name, so it is very easy to spoof this (for instance there's a command-line switch for this in SQLCMD.EXE). – Tibor Karaszi Mar 7 '20 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.