Search code examples
sql-serverloggingssmsevent-log

Logging to windows application event log


Hi this is basically what I want to do in sql server management studio.

Whenever any user tries to delete or update the data in the table, it needs to be logged into the Windows Application event log.

Is there anywhere I can reference how to do this? I can't find anything.

Thanks

Full Question:

As the Products table is a very important table, the company wishes to track selected changes to the table. Whenever any user tries to delete or update the data in the table, it should be logged into the Windows Application event log. However, there is no need to undo the changes as it may be a legitimate change.


Solution

  • You should use SQL Server Audit for that. When you create a server audit, specify audit destination to be Windows Application Log. For more information, see CREATE SERVER AUDIT (Transact-SQL). Since it is a school assignment, I believe it will be the best for you to try write it yourself. Good luck!