SQL Server 2005 - ModifyDate column - Does the computed column use the correct way to implement this?

I just want the "ModifyDate" column to automatically populate for me when the record is either inserted or updated.

Should I use triggers or use a calculated column normally?

(Using SSMS2005 and SQL Server 2005 Express)

+5
source share
3 answers

The INSERTed part is simple - just define a default value for this column, and when you insert a new row, do not specify a value for this column.

UPDATE - UPDATE, . , SQL Server .

: ? , "" , , ROWVERSION ( TIMESTAMP).

, - - INSERT UPDATE - .

+5

Date Modified , getDate .

:

FirstName = 'Jim', LastName = 'Jones', DateModified = getDate()

+3

, .

, . . , , , .

, , , . , , .

+2

All Articles