Sql server on update set current timestamp

后端 未结 2 1605
感动是毒
感动是毒 2020-12-10 05:50

I need a timestamp field which updates every time the user modifies the record.

So far I used MySql in which I can even use this in the field creation:



        
2条回答
  •  暖寄归人
    2020-12-10 06:17

    Use rowversion datatype. Rowversion is generally used as a mechanism for version-stamping table rows in MS-SQL server. The rowversion data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime2 data type. For more information please read about rowversion in msdn (http://technet.microsoft.com/en-us/library/ms182776.aspx)

提交回复
热议问题