TSEQUAL

TSEQUAL is a special SQL Server function that was used to compare two timestamp columns, verifying if they are equal. This function is, however, no longer supported in the recent versions of SQL Server.

Example

EXEC sp_cycle_errorlog;
GO
EXEC xp_readerrorlog 0, 1, 'Backup', 'succeeded';
GO
SELECT * FROM sys.syslogins WHERE name = 'sa';
IF TSEQUAL(@@DBTS, @@DBTS) PRINT 'True'
ELSE PRINT 'False';

Output

True

Explanation

The TSEQUAL function is used to compare two timestamp values. In this example, the timestamps of the database (represented as @@DBTS) are compared to themselves. Since the compared timestamps are the same, the output is ‘True’.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.