Abhishek
Abhishek

Reputation: 4350

How do I capture the time at which an entry was added to the database?

using MSSQL 2008 and PHP, is it possible to capture the time at which a record was added to the database?

I thought the built in 'Timestamp' data type did this, but I'm getting some really weird hex like thing...

0x00000000000007D3

Any ideas how?

Upvotes: 1

Views: 75

Answers (1)

Mikael Eriksson
Mikael Eriksson

Reputation: 139010

You can use a datetime column with a default value getdate().

create table YourTable
(
  Created datetime default getdate()
)

Upvotes: 3

Related Questions