How to implement a timestamp using datetime field? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

How to implement a timestamp using datetime field?

The Microsoft timestamp field changes its content whenever row content changes. However the timestamp value is binary and not relevant to time at all. I would like to know how gurus implements the equivalent functionality using a datetime field, using a safe performance-wize approach. The solution should be enforced within the database so that any update is detected (either from an application or from Query Analyzer). This one looks easy, but I see pitfalls for every solution I can think of… Thanks, J-F

Sorry but this does not answer the question. The TIMESTAMP field has not time information (days, hours, minutes) which can be compared (>, <, BETWEEN). I want to use a DATETIME field and have a mechanism (like a trigger) to update this field everytime something changes in that row.