Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

Current_timestamp Command in SQL Server

Understand Current_timestamp Command in SQL Server with clear explanations, practical examples, and useful tips. This updated guide covers the essential...

Table of Contents

This article will show you in detail how to use the datetime CURRENT_TIMESTAMP processing function in SQL Server with specific syntax and examples to better visualize and capture functions.

Describe

The SQL Server CURRENT_TIMESTAMP function returns the current date and time, in the format 'yyyy-mm-dd hh: mi: ss.mmm'.

Syntax

To use the CURRENT_TIMESTAMP function in SQL Server, we use the following syntax:

 CURRENT_TIMESTAMP 

There are no parameters and arguments in the CURRENT_TIMESTAMP statement.

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 CURRENT_TIMESTAMP function.
  • See also GETDATE function.
  • CURRENT_TIMESTAMP can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.

For example

Take a look and explore some examples of CURRENT_TIMESTAMP functions in SQL Server.

 SELECT CURRENT_TIMESTAMP; 
Result: '2019-02-22 15:29:59.917'

Last lesson: SUM function in SQL Server

Next article: DATEDIFF function in SQL Server

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.