Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
To get the date and time for a datetime value in SQL Server, use the GetDate method. It will return the current system date and time in the SQL Server standard internal format for datetime values.
This is a pretty useful function if you need to know the date/time in a select statement or a where clause.
SELECT GETDATE()
GO
Here is the result set:
————————-
April 10 2006 11:39 AM
(1 row(s) affected)