@@DBTS (Transact-SQL)
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
Syntax
@@DBTS
Note
To view Transact-SQL syntax for SQL Server 2014 (12.x) and earlier versions, see Previous versions documentation.
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 AdventureWorks2022 database.
USE AdventureWorks2022;
GO
SELECT @@DBTS;
See also
Configuration Functions (Transact-SQL)
Cursor Concurrency (ODBC)
Data Types (Transact-SQL)
MIN_ACTIVE_ROWVERSION (Transact-SQL)
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for