Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 How to crete History table

Author  Topic 

riyas.k13
Starting Member

1 Post

Posted - 2011-12-20 : 01:20:55
I have three tables
1. Country
2. State
3. City

The users have permission to insert, update, delete these tables. I want to get the history (Who,which item, when (insert, update, delete)) the data

Riyas K

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2011-12-20 : 01:26:21
Create a audit/history table insert the data with the help of trigger.

Senthil Kumar C
------------------------------------------------------
MCITP - Database Administration SQL SERVER 2008
MCTS - Database Development SQL SERVER 2008
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-20 : 03:18:59
use SUSER_SNAME() to capture user details
and COLUMNS_UPDATED() to get details of columns which were updated

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -