Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
How to add current system date and time to the column in SQL
4805 Views
Syntax
insert into tableName(columName) values(getdate());
Example
insert into orders(orderTime) values(getdate());
Hints 
getdate() is the function to get the current system time and date.It generate the time from the machine.Generated date and time Default format like yyyy-mm-dd hh:mm:ss.mmm
For example : 2014-02-21 01:41:12.143

NOTE :getdate() values can insert into datetime data type variable only.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details