SQL Server > Date Time related

Get current Date and time in SQL Server

How to get current Date and time in SQL Server?


To get current date and time in SQL Server, we can use GETDATE() or SYSDATETIME() functions.

SELECT GETDATE()
SELECT SYSDATETIME()

The first GETDATE() function gives the current date and time, the second SYSDATETIME() gives more precise value.

 Views: 4246 | Post Order: 72



Write for us