When it comes to getting the current date and time in Microsoft SQL Server, you have a number of options:

GETDATE()

The GETDATE() function is usually the go-to for most people.

You can invoke it from pretty much anywhere, even in the definition of default values.

SELECT GETDATTE()

SYSDATETIME()

We also have access to the SYSDATETIME() function, which is pretty much a drop-in replacement for GETDATE().

This returns a DateTime2(7)

SELECT SYSDATETIME()

CURRENT_TIMESTAMP

Another option is the CURRENT_TIMESTAMP function (note the lack of opening and closing brackets).

These are specific to the server’s current locale. For date functions that factor in time zones, that is the stuff of a future post.

TLDR

There are a number of different ways to get the current date from the server.

Happy hacking!