getdate modified ?

Results 1 to 2 of 2

Thread: getdate modified ?

  1. #1
    PatrickLocke Guest

    Default getdate modified ?

    If I build a table with the a smalldatetime column set to default: (getdate()) its get the date a record is created.<BR>fine.<BR><BR>Now i have another column called "date_modifed".<BR>is there something i can set in default to get the date everytime a the column is updated without having to ad it to my SQL update statement?<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Easy answer.....NO

    if you are going to have the modified date in the SAME table with a default it will have a date the time the record is inserted.<BR><BR>But that is fine cause technically insert is also modified as in the time it was created it was modified and so on. <BR><BR>What you may wnat to do id write an update trigger and modify that col when the record is updated. Dont bother with a default.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts