简体   繁体   中英

Is there a way to tell the last date time a table was modified in SQL Server 2012

Is there a way to tell the last date time any table records were modified in SQL Server 2012? without having to put in a column for last update in table.

The idea is not to query say a 10 million record table when no rows were changed.

Is there a way to tell the last date time any table records were modified in SQL Server 2012? without having to put in a column for last update in table.

Yes - you can write an update/insert/delete trigger on the table that records the fact that an update happened along with the date and time.

The idea is not to query say a 10 million record table when no rows were changed.

You might also want to look at the built in Change Tracking features

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM