Search code examples
c#sqlsqlcachedependency

SQL Column name for indicating a change


I didn't really know how to formulate the title. But this is my problem. We are using SqlCacheDependencies to update out cache objects. But the query behind this is "complicated" that we would like to make it somewhat easier.

Our first thought was to add a fieldname like DateChanged and use the DateChanged to check if an object has actually changed in stead of loading all the columns of a table.

SELECT DateChanged FROM Table1

in stead of

SELECT Id, Title, DateChanged, Description FROM Table1

But I was hoping someone could tell me if there are other ways to do this or if there are standards for naming the column that indicates a change. How are frameworks like "Entity framework" or "NHibernate" handle this?


Solution

  • It's usually called " timestamp"

    ie in