Inserting current system date and time into column
I want to write a stored procedure which can insert current date and time(from system) into table column
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anuja PawarPosted Dec 2, 2011, 2:52 AM
INSERT INTO TABLE (COL1) VALUES SELECT getdate()
If you need date in one column and time in another, then use
INSERT INTO TABLE (COL1,COL2) VALUES(
SELECT convert(varchar(20),getdate(),105),
SELECT convert(varchar(20),getdate(),108))
105 for date :02-12-2011
108 for time:13:21:43
Hope it helps :)