Skip to main content
Inspiring
February 3, 2010
Question

Auto update of date field - SQL Server 2005

  • February 3, 2010
  • 2 replies
  • 1078 views

HI folks,

Is there a way I can automatially tell when a record was last updated?

I can set a field to get the date by using getdate(), but is there a way SQL server will insert the timestamp, without me having to create the date object in CF, then inserting it.

I'd like to add a 'last updated' function to my CMS.

Thanks in advance

This topic has been closed for replies.

2 replies

Inspiring
February 4, 2010

For UPDATE you are looking at trigger.

http://msdn.microsoft.com/en-us/library/ms189799.aspx

Inspiring
February 3, 2010

most databases allow you to set default values for fields.  ms sql is probably one of those dbs.