开发者

Using Entity Framework how can i find out when the last change was made to a table?

Is there a quick way to find out when last change took place in some table?

EDIT:

I realize that i can add a column which will hold a change date, but i am wondering if there is so开发者_如何学Pythonme kind of metadata that can be accessed by EF. My db is hosted on SQL Server 2008.


Add a 'last updated' column to your table and query that one for the latest change.

Update: If that is not an option as per the update to the question, you could:
a) create a separate db table with table name and date/time and update that one with triggers on the table you want to track.
...or...
b) since you're using SQL Server 2008 you could possibly do something with SQL Server change tracking. There's no built-in support for change tracking in EF, but that doesn't prevent you from using it 'on the side'...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜