Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
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.
Transact-SQL syntax conventions
@@DBTS
varbinary
@@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.
This example returns the current timestamp from the AdventureWorks2022 database.
USE AdventureWorks2022;
GO
SELECT @@DBTS;
Configuration Functions (Transact-SQL)
Cursor Concurrency (ODBC)
Data Types (Transact-SQL)
MIN_ACTIVE_ROWVERSION (Transact-SQL)
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today