Skip to content

Latest commit

 

History

History
37 lines (32 loc) · 2.67 KB

File metadata and controls

37 lines (32 loc) · 2.67 KB
title Change Tracking Functions (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 08/08/2016
ms.prod sql
ms.prod_service database-engine, sql-database
ms.reviewer
ms.technology system-objects
ms.topic language-reference
dev_langs
TSQL
helpviewer_keywords
functions [SQL Server], change tracking
change tracking [SQL Server], functions
ms.assetid 04eb53c4-8b69-414e-9696-185d227fea35
author rothja
ms.author jroth
monikerRange =azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current

Change Tracking Functions (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-asdb-xxxx-xxx-md]

Change tracking records insert, update, and delete activity applied to tracked tables, supplying the details of the changes in an easily consumed relational format. The following functions return information about the changes.

Function Description
CHANGETABLE (CHANGES) Returns tracking information for all changes to a table that have occurred since a specified version.
CHANGETABLE (VERSION) Returns the latest change tracking information for a specified row.
CHANGE_TRACKING_MIN_VALID_VERSION() Returns the minimum version that is valid for use in obtaining change tracking information from the specified table when you are using the CHANGETABLE function.
CHANGE_TRACKING_CURRENT_VERSION Obtains a version that is associated with the last committed transaction. You can use this version the next time you enumerate changes by using CHANGETABLE.
CHANGE_TRACKING_IS_COLUMN_IN_MASK Interprets the SYS_CHANGE_COLUMNS value that is returned by the CHANGETABLE(CHANGES ...) function.
WITH CHANGE_TRACKING_CONTEXT Enables the specification of a change context, such as an originator ID, when an application changes data.

See Also

Track Data Changes (SQL Server)