SQL Server: CURRENT_TIMESTAMP function

CURRENT TIMESTAMP function

This SQL Server tutorial explains how to use the CURRENT TIMESTAMP function in SQL Server (Transact-SQL) with syntax and examples.

Description

In SQL Server (Transact-SQL), the CURRENT TIMESTAMP function returns the current date and time.

Syntax

The syntax for the CURRENT_TIMESTAMP function in SQL Server (Transact-SQL) is:

CURRENT_TIMESTAMP

Parameters or Arguments

There are no parameters or arguments for the CURRENT_TIMESTAMP function.

Note

  • The CURRENT_TIMESTAMP function returns the system date and time in the format ‘yyyy-mm-dd hh:mi:ss.mmm‘.
  • Do not put parentheses () after the CURRENT_TIMESTAMP function.
  • See also the GETDATE function.

Applies To

The CURRENT_TIMESTAMP function can be used in the following versions of SQL Server (Transact-SQL):

  • SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005

Example

Let’s look at some SQL Server CURRENT_TIMESTAMP function examples and explore how to use the CURRENT_TIMESTAMP function in SQL Server (Transact-SQL).

For example:

SELECT CURRENT_TIMESTAMP;
Result: '2014-05-01 15:29:59.917'

This Post Has 2 Comments

Leave a Reply