@@DBTS (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

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.

Topic link icon 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 AdventureWorks2012 database.

USE AdventureWorks2012;  
GO  
SELECT @@DBTS;  

See also

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