How to get Current Date and Time in SQL
Ever wondered that how can I get the current Date and Time in SQL, just the way we dot in VB.Net using Date.now. Well it is more simple than you thought
Use T-SQL command CURRENT_TIMESTAMP
This will return the current date and time value without the database time zone offset.
How do i use it? It’s very simple……
Select CURRENT_TIMESTAMP (returns the current date and time)
Update table1 set ddate = CURRENT_TIMESTAMP (updates table1 and sets value of field ddate to current date and time)
Hope you find this article useful….
Hey this post was really very helpful!!!!
Jabir
October 27, 2009 at 10:51 am