| title | @@DBTS (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 09/18/2017 | ||
| ms.prod | sql | ||
| ms.prod_service | database-engine, sql-database | ||
| ms.service | |||
| ms.component | t-sql|functions | ||
| ms.reviewer | |||
| ms.suite | sql | ||
| ms.technology |
|
||
| ms.tgt_pltfrm | |||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | 91842ddd-91c0-4445-a03f-116f6bc991d0 | ||
| caps.latest.revision | 35 | ||
| author | edmacauley | ||
| ms.author | edmaca | ||
| manager | craigg | ||
| ms.workload | On Demand |
[!INCLUDEtsql-appliesto-ss2008-asdb-xxxx-xxx-md]
Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database.
Transact-SQL Syntax Conventions
@@DBTS
varbinary
@@DBTS returns the last-used timestamp value of the current database. A new timestamp value is generated when a row with a timestamp column is inserted or updated.
The @@DBTS function is not affected by changes in the transaction isolation levels.
The following example returns the current timestamp from the [!INCLUDEssSampleDBnormal] database.
USE AdventureWorks2012;
GO
SELECT @@DBTS; Configuration Functions (Transact-SQL)
Cursor Concurrency (ODBC)
Data Types (Transact-SQL)
MIN_ACTIVE_ROWVERSION (Transact-SQL)