Auto date colum
-
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
-
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
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