bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server SYSDATETIME() Function

Concept visual

SQL Server SYSDATETIME() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return the date and time of the SQL Server:

SELECT SYSDATETIME() AS SysDateTime;

Definition and Usage

The SYSDATETIME() function returns the date and time of the computer where the SQL Server is running.

Syntax

Sysdatetime()

Technical Details

Return type:

datetime2(7)

Works in:

SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse

Previous

❮ SQL Server Functions

Next

Previous

SQL Server MONTH() Function

Next

SQL Server YEAR() Function