Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 2.08 KB

with-change-tracking-context-transact-sql.md

File metadata and controls

52 lines (40 loc) · 2.08 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs monikerRange
WITH CHANGE_TRACKING_CONTEXT (Transact-SQL)
WITH CHANGE_TRACKING_CONTEXT (Transact-SQL)
rwestMSFT
randolphwest
08/08/2016
sql
system-objects
reference
WITH_CHANGE_TRACKING_CONTEXT_TSQL
WITH CHANGE_TRACKING_CONTEXT
WITH CHANGE_TRACKING_CONTEXT
change tracking [SQL Server], WITH CHANGE_TRACKING_CONTEXT
TSQL
=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current

WITH CHANGE_TRACKING_CONTEXT (Transact-SQL)

[!INCLUDE SQL Server SQL Database]

Enables the context of a change to be specified, such as an originator ID, when data is changed. For example, when using change tracking, an application might want to differentiate between changes that were made by the application itself and changes that were made to the data outside the application.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

  
WITH CHANGE_TRACKING_CONTEXT ( context )  

Parameters

context
Is the contextual information that is supplied by the calling application and stored with the change tracking information for the change. context is varbinary(128).

The value can be a constant or a variable, but cannot be NULL.

Examples

The following example sets the change tracking context for a data change.

WITH CHANGE_TRACKING_CONTEXT ( context )  

See Also

Change Tracking Functions (Transact-SQL)
CHANGETABLE (Transact-SQL)
Track Data Changes (SQL Server)