Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi!

My problem is, that I need to check, when a row was last modified, but I don't have any column, that contains the data. My question is: Is there any way, that I can check this Data?

THX, for any answers!
Posted
Comments
Ankur\m/ 5-Mar-14 3:39am    
I don't think so.

No you cannot determine last updated date on a row level. It doesn't make sense for SQL server to keep such record. Think the amount of space and other overheads that will be required. Though last modified details are saved at object level.

You may also check this post - SqlServer row date last modified[^]
 
Share this answer
 
You cannot have the information when the information is not available.
Since you cannot alter the original table, one way I can think of is to create a new table that has only 2 fields - an id field and a datetime field. The id field will link to the primary key of the original table. Whenever a row is inserted, updated, or deleted in the orginal table, it should also insert/update the corresponding id row in the new table with the current datetime value. You may use trigger to automate this process. In this way, you can keep track of any changes made to any row in the original table.
 
Share this answer
 
v3

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