Search code examples
c#.netsql-server-2008sqldependency

How can i track any changes to Database table


I have 2 applications, one to add in database, and the other to watch any changes in database,

How can i track any changes in db ( new record, Change of existing one, deleting), Is there any class like system watcher to watch Database Table?

i searched and found SQL Dependency Class, but i don't know whether it is suitable to my scenario or not.

Thanks in advance,


Solution

  • You could use a trigger, to check the INSERT, UPDATE or DELETE queries they are executed in your instance.

    Furthermore, SQL Server has a great tool, SQL Server Profiler. You can use it to connect to your instance and listen to every query and action.

    This SO question maybe could help you.