Click here to Skip to main content
15,914,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All
How to check which table and which field updated or changes in sql server 2005 or 2008

please help me ...
Posted

There is no built in way to identify which record was changed. You can implement audit trail for all the tables and use that to identify the changes.

If you are interested in knowing about the schema changes i.e. if a new column was added or altered in a table, check modified_date column in sys.tables table.
 
Share this answer
 
If you are talking about table structure then use,
for table modifiction
SQL
select Name,create_date,modify_date from sys.objects where type='u' 

you can fetch column update's date if column is primary key/foreign key like this
SQL
select Name,create_date,modify_date from sys.objects where type='p' or type='F'


for all columns modification date, you have to put trigger on table modification. and save entries inside a new table.

Note: when ever you will rename column table-modification trigger will not be fired. so, that case you will not able to save 'renamed' column's changes.

Happy Coding!
:)
 
Share this answer
 
Comments
ram salunke 29-Oct-12 7:15am    
Thank u so much...
Aarti Meswania 29-Oct-12 7:18am    
welcome :)

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