Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.83 KB

dbts-transact-sql.md

File metadata and controls

57 lines (43 loc) · 1.83 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
DBTS (Transact-SQL)
@@DBTS (Transact-SQL)
markingmyname
maghan
09/18/2017
sql
t-sql
reference
@@DBTS_TSQL
@@DBTS
@@DBTS function
timestamp data type
TSQL

@@DBTS (Transact-SQL)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance]

This function returns the value of the current timestamp data type for the current database. The current database will have a guaranteed unique timestamp value.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

@@DBTS  

Return types

varbinary

Remarks

@@DBTS returns the last-used timestamp value of the current database. An insert or update of a row with a timestamp column generates a new timestamp value.

Changes to the transaction isolation levels do not affect the @@DBTS function.

Examples

This example returns the current timestamp from the [!INCLUDEssSampleDBnormal] database.

USE AdventureWorks2022;  
GO  
SELECT @@DBTS;  

See also

Configuration Functions (Transact-SQL)
Cursor Concurrency (ODBC)
Data Types (Transact-SQL)
MIN_ACTIVE_ROWVERSION (Transact-SQL)