Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to keep the track of all operation that we perform in one table and store in another table for example
i have a table name table1
i have inserted a record in table1

i want the that operation is record in another table that i have inserted a record


i wnat script of this problem
Please help me thanks in advance
Posted
Comments
Nelek 4-Dec-12 16:50pm    
This is not how CP usually works.
You are supposed to try it on your own and come here to ask a question or give a description of a problem you have. What you are saying just are the requirements of a task. Don't forget people here don't get payed, they help because they want to and the most important objective of CP is to learn. If someone does the job for you, you are not going to learn anything.
sajjadaslam3 4-Dec-12 17:27pm    
Sorry i will care about it next time .Thanks

You need to build a strategy for this operation. It is called auditing and you need to decide what you are going to track. Every change on every table, only changes, only deletes, only on some tables.

You need a target table to store the information you are auditing.
You then need to create the triggers to be applied to each table for each operation.

We have an audit schema table where the developer checks the 3 operations against each table, a stored procedure that reads the schema table and creates the triggers based on the developer flag.
 
Share this answer
 
Have you considered using triggers to insert records in a separate table?

http://msdn.microsoft.com/en-us/library/ms189799(v=sql.100).aspx[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900