Click here to Skip to main content
13,590,079 members
Rate this:
Please Sign up or sign in to vote.
i have an MS SQL Server Express edition, and i want to know if there were new products encoded in my application thru my database, or if user encoded new employees or change employee information. i want those changes stored in another table so i can easily see what are those and from which tables.

What I have tried:

i was thinking of creating a trigger for this but that would require me to add triggers to each tables. if there's a trigger for the changes in database?
Posted 7-Aug-16 20:24pm
Updated 8-Aug-16 19:49pm
Orcun Iyigun 8-Aug-16 2:46am
You might consider looking up 3 SQL Server auditing features (Change Tracking, Change Data Capture and SQL Server Auditing)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


Please follow this lin explained about trigger for insert,update,delete in tables and you can find the sample table and script also.
Trigger-Insert,Update,Delete in tables

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

      [db_name] =
    , [table_name] = SCHEMA_NAME(o.[schema_id]) + '.' +
    , s.last_user_update
FROM sys.dm_db_index_usage_stats s
JOIN sys.databases d ON s.database_id = d.database_id
JOIN sys.objects o ON s.[object_id] = o.[object_id]
WHERE o.[type] = 'U'
    AND s.last_user_update IS NOT NULL
    AND s.last_user_update BETWEEN DATEADD(wk, -1, GETDATE()) AND GETDATE()

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.180618.1 | Last Updated 9 Aug 2016
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100