datetime value.
GETDATE ( )
GETDATE() returns the current date and time of the server on which SQL Server is running. This value is a datetime data type. It reflects the time when the function is executed within the current session.
datetime
SELECT GETDATE();
This will return a result similar to:
2023-10-27 10:30:55.123
Assuming you have a table named Orders with a column OrderDate of type datetime:
INSERT INTO Orders (OrderDate, CustomerID) VALUES (GETDATE(), 101);
GETDATE() is a nondeterministic function. Every time GETDATE() is called within a single statement, it may return a different value.GETDATE() is equivalent to SYSDATETIME() in terms of the value returned. However, SYSDATETIME() has a larger range and higher precision.GETDATE() is supported.DATEADD, DATEDIFF, and DATENAME to manipulate and extract parts of the date and time returned by GETDATE().