Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Auto date colum

Auto date colum

Scheduled Pinned Locked Moved Database
databasetutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zee_Zee
    wrote on last edited by
    #1

    Hi All! I need to put a column in a table and want that column to store the date at which that particular row was updated or some new row is added into the table. I am doing this to check when the table is updated. Kindly guide me for creating such a column in SQL. With best regards, Zee_Zee

    D 1 Reply Last reply
    0
    • Z Zee_Zee

      Hi All! I need to put a column in a table and want that column to store the date at which that particular row was updated or some new row is added into the table. I am doing this to check when the table is updated. Kindly guide me for creating such a column in SQL. With best regards, Zee_Zee

      D Offline
      D Offline
      David Salter
      wrote on last edited by
      #2

      If you want to store the time a row is inserted, create a default on it with a value of getdate() e.g. create table foo ( bar datetime default getdate() ) If you want to know the time a row is updated, try using a trigger and setting the time (via getdate) in the trigger. store your internet favourites online - www.my-faves.co.uk

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups