Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic Adding Current DateTime In TableField

I am using SQL SERVER 2005 and i am also newbie to SQL SERVER

now i need to know that is there any way or any technique in SQL SERVER 2005

such that as soon as i add new record in table then current date-time should be added in to any given field of table.

Example:

Suppose i have CUSTOMER table and it has fields say CustomerID,CustomerName,....,DateTime. now whenever new customer added in this table then current date-time should be automatically added in to DateTime Field of CUSTOMER table.

like image 430
Aryan SuryaWansi Avatar asked Jul 06 '11 09:07

Aryan SuryaWansi


1 Answers

In SSMS one can set the Default value or binding property of the appropriate column of the table property to getdate().

like image 141
Nico Beemster Avatar answered Oct 20 '22 20:10

Nico Beemster