Making a DateTime field in a database automatic?

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-16T16:02:43Z Indexed on 2010/03/17 11:21 UTC
Read the original article Hit count: 434

I'm putting together a simple test database to learn MVC with. I want to add a DateTime field to show when the record was CREATED.

ID = int
Name = Char
DateCreated = (dateTime, DateTime2..?)

I have a feeling that this type of DateTime capture can be done automatically - but that's all I have, a feeling. Can it be done? And if so how?

While we're on the subject: if I wanted to include another field that captured the DateTime of when the record was LAST UPDATED how would I do that.

I'm hoping to not do this manually.

Many thanks

Mike

© Stack Overflow or respective owner

Related posts about datetime

Related posts about database-design