Contents Diagrams Roles Schemas Tables Views Procedures Functions

Change Tracking Framework
for Microsoft SQL Server

Version 2.0, September 10, 2018

Contents

Introduction

Change Traking Framework

Change Tracking Framework allows tracking and reverting data changes in Microsoft SQL Server databases.

Key principles of the framework:

- Adding tracking features without modifying the underlying tables;
- Managing tracking features in Microsoft Excel;
- Checking and reverting data changes in Microsoft Excel;
- Working in free Microsoft SQL Server Express.

The core concept is simple:

- Adding triggers on INSERT, UPDATE, and DELETE operations to captured tables;
- Storing changes in XML format in the single logs.change_logs table;
- Creating a procedure to select changes for every captured table;
- Generating the required configuration for the SaveToDB add-in to implement the required features.

Here is an example of the context menu for administrators:

Change Tracking Framework - Administrator Context Menu

Here is an example of the context menu for end-users:

Change Tracking Framework - User Context Menu

You may read more in the e-book Change Tracking Framework for SQL Server.

This is a technical paper for developers.

You may install, update, and remove Change Tracking Framework using SaveToDB Application Installer wizard.

You may generate a workbook to edit configure tracking using the SaveToDB Application Workbooks wizard.

Feel free to contact us.

Change History

Version 2.0, September 10, 2018

Change Tracking Framework 2.0 requires SaveToDB 8.11 or higher.

New Features:

Impovements:

Bug Fixes:

Diagrams

DiagramDescription
Diagram C01Change Tracking Framework Data Tables
Diagram C02Change Tracking Framework Configuration Tables

Diagram C01. Change Tracking Framework Data Tables

Change Tracking Framework Data Tables

Change Tracking Framework allows tracking changes of the configured tables.

Use the logs.view_captured_objects view to check and create table triggers for tracking changes.

These triggers write table record changes into the logs.change_logs table.

The framework generates the required configuration using logs.view_administrator_handlers and logs.view_translations views to add the context menu items for tracking changes in Microsoft Excel.

Use the logs.base_tables table to link views and procedures to the underlying tables.
The framework generates context menu items for such views and procedures using settings of the specified base tables.

Add users who can check changes to the log_users role.
These users can revert changes if they have INSERT, UPDATE, and DELETE permissions on the underlying tables.

Add users who can configure change tracking features to the log_administrators role.
The administators must have the permission to CREATE and DROP triggers in the target schema.
To clear logs, administators must also have UPDATE permissions on the captured tables.

The generated triggers and procedures use the logs.tables table to find the underlying objects if the underlying object_id or name are changed.

Diagram C02. Change Tracking Framework Configuration Tables

Change Tracking Framework Configuration Tables

Change Tracking Framework includes complete copies of SaveToDB Framework tables.

This allows using Change Tracking Framework as is, without additional requirements.

The logs.handlers table contains the handler configuration.
It configures action menu items.

The logs.translations table contains translations of database objects, columns, parameters, and generated help headers.

The logs.formats table contains Excel table formats for framework objects.
The SaveToDB add-in applies these formats in the first connection to database objects.
Users can save and reload table formats using SaveToDB Table Format Wizard or Save Table Format and Load Table Format menu items.

The logs.workbooks table contains a configuration to generate a workbook to edit the database help.
Use the Application Workbooks wizard to generate it.

Roles

RoleDescription
log_administratorsThe role includes permissions to use customize tracking features.
log_usersThe role includes permissions to use change tracking features.

log_administrators

The role includes permissions to use customize tracking features.

Assign this role to users who can create and drop triggers and clear change tracking logs.

See actual database permissions in the logs.xl_actions_set_role_permissions procedure.

log_users

The role includes permissions to use change tracking features.

Assign this role to business users who use the change tracking functions.

See actual database permissions in the logs.xl_actions_set_role_permissions procedure.

Schemas

SchemaDescription
logsThe schema contains Change Tracking Framework tables, views, and procedures.

logs

The schema contains Change Tracking Framework tables, views, and procedures.

The schema contains objects used by the application, users, and administrators.

See actual permissions in the logs.xl_actions_set_role_permissions procedure.

Tables

TableDescription
logs.base_tablesThis user table contains a configuration used to attach context menu items to database objects.
logs.change_logsThis application table contains change tracking data for all captured tables.
logs.formatsThis application table contains Excel table formats of the change tracking framework objects.
logs.handlersThis application table contains event handler configuration of the change tracking framework objects.
logs.tablesThis application table contains initial object_id and table names.
logs.translationsThis application table contains translation data of the change tracking framework objects.
logs.workbooksThis application table contains workbook configuration for SaveToDB Application Workbooks wizard.

logs.base_tables

This user table contains a configuration used to attach context menu items to database objects.

ColumnDataTypeNullComment
IDintIdentity
OBJECT_SCHEMAnvarchar(128)Configured object schema
OBJECT_NAMEnvarchar(128)Configured object name
BASE_TABLE_SCHEMAnvarchar(128)Underlying table schema
BASE_TABLE_NAMEnvarchar(128)Underlying table name

Use this table to link views and procedures to the underlying tables.

The framework generates context menu items for such views and procedures using settings of the specified base tables.

Example:

Change Tracking Framework - Attaching Context Menus

See also Attaching Context Menus.

logs.change_logs

This application table contains change tracking data for all captured tables.

ColumnDataTypeNullComment
change_idintIdentity
Unique change ID
object_idintobject_id of the table of changes calculated by the OBJECT_ID function
idintIDENTITY field value of the table of changes if exists
keysnvarchar(445)The string value of keys of the table of changes
insertedxmlXML value of the inserted row and new values of the updated row
deletedxmlXML value of the deleted row and old values of the updated row
change_typetinyintChange type:

1 - INSERT
2 - DELETE
3 - UPDATE
change_datedatetimeDate and time of changes calculated by the GETDATE function
change_usernvarchar(128)User of changes calculated by the GETUSER function

Do not edit this table manually.

The table contains primary keys and both current and previous row values of source records in an XML format.

logs.formats

This application table contains Excel table formats of the change tracking framework objects.

ColumnDataTypeNullComment
IDintIdentity
TABLE_SCHEMAnvarchar(128)xls.formats.TABLE_SCHEMA
TABLE_NAMEnvarchar(128)xls.formats.TABLE_NAME
TABLE_EXCEL_FORMAT_XMLxmlxls.formats.TABLE_EXCEL_FORMAT_XML

This table is a copy of the xls.formats table of the SaveToDB Framework to avoid external dependency.

See also Configuring Table Formats.

logs.handlers

This application table contains event handler configuration of the change tracking framework objects.

ColumnDataTypeNullComment
IDintIdentity
TABLE_SCHEMAnvarchar(20)xls.handlers.TABLE_SCHEMA
TABLE_NAMEnvarchar(128)xls.handlers.TABLE_NAME
COLUMN_NAMEnvarchar(128)xls.handlers.COLUMN_NAME
EVENT_NAMEvarchar(25)xls.handlers.EVENT_NAME
HANDLER_SCHEMAnvarchar(20)xls.handlers.HANDLER_SCHEMA
HANDLER_NAMEnvarchar(128)xls.handlers.HANDLER_NAME
HANDLER_TYPEnvarchar(25)xls.handlers.HANDLER_TYPE
HANDLER_CODEnvarchar(max)xls.handlers.HANDLER_CODE
TARGET_WORKSHEETnvarchar(128)xls.handlers.TARGET_WORKSHEET
MENU_ORDERintxls.handlers.MENU_ORDER
EDIT_PARAMETERSbitxls.handlers.EDIT_PARAMETERS

This table is a copy of the xls.handlers table of the SaveToDB Framework to avoid external dependency.

The framework also inserts and deletes handlers of every captured table here.
Such handlers define the context menu actions to select and revert changes.

See also Configuring Event Handlers.

logs.tables

This application table contains initial object_id and table names.

ColumnDataTypeNullComment
object_idintTable object_id obtained on creating change tracking triggers.
TABLE_SCHEMAnvarchar(128)Table schema obtained on creating change tracking triggers.
TABLE_NAMEnvarchar(128)Table name obtained on creating change tracking triggers.

The application uses this table to find the target table after changes in object_id or table names, but not in both.

logs.translations

This application table contains translation data of the change tracking framework objects.

ColumnDataTypeNullComment
IDintIdentity
TABLE_SCHEMAnvarchar(128)xls.translations.TABLE_SCHEMA
TABLE_NAMEnvarchar(128)xls.translations.TABLE_NAME
COLUMN_NAMEnvarchar(128)xls.translations.COLUMN_NAME
LANGUAGE_NAMEchar(2)xls.translations.LANGUAGE_NAME
TRANSLATED_NAMEnvarchar(128)xls.translations.TRANSLATED_NAME
TRANSLATED_DESCnvarchar(255)xls.translations.TRANSLATED_DESC
TRANSLATED_COMMENTnvarchar(4000)xls.translations.TRANSLATED_COMMENT

This table is a copy of the xls.translations table of the SaveToDB Framework to avoid external dependency.

You may edit the translation and add new translations for the required languages.

You may use the logs.usp_translations procedure to edit translation for multiple languages in a pivot table and the logs.view_translations view to check and edit the translation of all database objects.

See also Configuring Data Translation.

logs.workbooks

This application table contains workbook configuration for SaveToDB Application Workbooks wizard.

ColumnDataTypeNullComment
IDintIdentity
NAMEnvarchar(128)Workbook name
TEMPLATEnvarchar(255)Template workbook path or URL.

The template workbook is not necessary.
The add-in can create a workbook using the definition only.
However, you may supply the workbook to have special features.

You may use Wizards, Developer Wizard, Prepare Workbook for Distribution to remove sensitive data and passwords from the workbook.
DEFINITIONnvarchar(max)Workbook definition.

Use the Help, Workbook Information, Workbook Definition menu item to get the definition of any opened workbook.

The SaveToDB add-in allows generating workbooks using the Application Workbooks wizard.

The add-in loads the workbook configuration from this table.

This is an application table.
If you need to generate other application workbooks, use the xls.workbooks table.

See also Configuring Application Workbooks.

Views

ViewDescription
logs.view_administrator_handlersThis view selects the handler configuration for the Actions menu.
logs.view_captured_objectsThis view selects database objects and related change tracking framework information.
logs.view_query_listThis view selects framework objects for the SaveToDB Connection Wizard and SaveToDB Query List.
logs.view_translationsThis view selects the translation configuration for the SaveToDB add-in.
logs.view_user_handlersThis view selects the handler configuration for the context menu.

logs.view_administrator_handlers

This view selects the handler configuration for the Actions menu.

ColumnDataTypeComment
TABLE_SCHEMAnvarchar(128)INFORMATION_SCHEMA.TABLES.TABLE_SCHEMA
TABLE_NAMEnvarchar(128)INFORMATION_SCHEMA.TABLES.TABLE_NAME
COLUMN_NAMEnvarchar(128)NULL
EVENT_NAMEvarchar(7)Actions
HANDLER_SCHEMAvarchar(4)logs
HANDLER_NAMEvarchar(31)Handler object name:
- Create Change Tracking Triggers
- Drop Change Tracking Triggers
HANDLER_TYPEvarchar(13)CODE or MENUSEPARATOR
HANDLER_CODEnvarchar(max)SQL code of the handler object
TARGET_WORKSHEETnvarchar(128)NULL
MENU_ORDERintHandler order in the context menu (190, 191, 192)
EDIT_PARAMETERSbit1 - Always show the Edit Parameters dialog box

This view generates the event handler configuration for every table and adds the following items to the Actions menu:
- Create Change Tracking Triggers
- Drop Change Tracking Triggers

Use DENY SELECT on this view to disable the feature.

logs.view_captured_objects

This view selects database objects and related change tracking framework information.

ColumnDataTypeComment
object_idintsys.objects.object_id
schemanvarchar(128)sys.schemas.name
namenvarchar(128)sys.objects.name
insert_triggernvarchar(128)sys.triggers.name with the 'trigger_<name>_log_insert' name
update_triggernvarchar(128)sys.triggers.name with the 'trigger_<name>_log_update' name
delete_triggernvarchar(128)sys.triggers.name with the 'trigger_<name>_log_delete' name
select_handlernvarchar(128)sys.procedures.name with the 'xl_log_<schema>.<name>' name
has_log_triggersint1 - has triggers
0 - has no triggers

Use this view to configure and check change tracking triggers.

Here is an example of the Excel form:

Context Menu for Configuring Change Tracking

logs.view_query_list

This view selects framework objects for the SaveToDB Connection Wizard and SaveToDB Query List.

ColumnDataTypeComment
TABLE_SCHEMAnvarchar(128)sys.schemas.name
TABLE_NAMEnvarchar(128)sys.objects.name
TABLE_TYPEnvarchar(60)sys.objects.type
TABLE_CODEnvarchar(max)NULL
INSERT_PROCEDUREnvarchar(max)NULL
UPDATE_PROCEDUREnvarchar(max)NULL
DELETE_PROCEDUREnvarchar(max)NULL
PROCEDURE_TYPEnvarchar(50)NULL

The view selects framework objects used to connect in Excel, logs.base_tables and logs.view_objects.

See also Configuring Query Lists.

logs.view_translations

This view selects the translation configuration for the SaveToDB add-in.

Source tables: logs.handlers, logs.translations

ColumnDataTypeComment
TABLE_SCHEMAnvarchar(20)logs.handlers.HANDLER_SCHEMA
TABLE_NAMEnvarchar(128)logs.handlers.HANDLER_NAME
COLUMN_NAMEnvarchar(128)logs.handlers.COLUMN_NAME
LANGUAGE_NAMEchar(2)logs.translations.LANGUAGE_NAME
TRANSLATED_NAMEnvarchar(128)logs.translations.TRANSLATED_NAME
TRANSLATED_DESCnvarchar(255)logs.translations.TRANSLATED_DESC
TRANSLATED_COMMENTnvarchar(4000)logs.translations.TRANSLATED_COMMENT

This view generates the translation of the logs.view_handlers handlers for the SaveToDB add-in.

See also Configuring Data Translation.

logs.view_user_handlers

This view selects the handler configuration for the context menu.

Source tables: logs.base_tables, logs.handlers

ColumnDataTypeComment
TABLE_SCHEMAnvarchar(128)Configured object schema
TABLE_NAMEnvarchar(128)Configured object name
COLUMN_NAMEnvarchar(128)Column or parameter name of the configured object
EVENT_NAMEvarchar(25)ContextMenu or SelectionChange
HANDLER_SCHEMAnvarchar(30)Handler object schema
HANDLER_NAMEnvarchar(128)Handler object name
HANDLER_TYPEnvarchar(25)Handler object type
HANDLER_CODEnvarchar(max)SQL code of the handler object
TARGET_WORKSHEETnvarchar(128)Handler output target
MENU_ORDERintHandler order in the context menu (20, 21, 30, 31, 32, 100, 110, 111, 112, 113, 114)
EDIT_PARAMETERSbit1 - Always show the Edit Parameters dialog box
0 - Always suppress the Edit parameters dialog box
NULL - show Edit Parameteres for the Actions menu and suppress for the context menu

This view generates the event handler configuration for captured tables and derived objects configured in the logs.base_tables table.

Such handlers allow using the context menu to check and revert changes.

See also Configuring Event Handlers.

Procedures

ProcedureDescription
logs.usp_translationsThis procedure is an Excel form to select and edit translations in all languages.
logs.usp_translations_changeThis procedure updates a database on cell changes of logs.usp_translations.
logs.xl_actions_clear_logsThis procedure clears change tracking records of the specified target table.
logs.xl_actions_create_change_tracking_triggersThis procedure creates change tracking triggers of the specified target table.
logs.xl_actions_drop_all_change_tracking_triggersThis procedure drops all change tracking triggers and clears all logs.
logs.xl_actions_drop_change_tracking_triggersThis procedure drops change tracking triggers of the specified target table.
logs.xl_actions_restore_current_recordThis procedure restores the current version of the changelog record.
logs.xl_actions_restore_previous_recordThis procedure restores the previous version of the changelog record.
logs.xl_actions_restore_recordThis procedure restores a row from the changelog record.
logs.xl_actions_select_lookup_idThis procedure selects rows from tables referenced by foreign keys.
logs.xl_actions_select_recordThis procedure selects change details of a changelog record.
logs.xl_actions_select_recordsThis procedure selects changelog records.
logs.xl_actions_set_role_permissionsThis procedure sets permissions for the log_administrators and log_users roles.
logs.xl_export_settingsThis procedure exports Change Tracking Framework settings.
logs.xl_import_handlersThis procedure imports Change Tracking Framework settings into logs.handlers.

logs.usp_translations

This procedure is an Excel form to select and edit translations in all languages.

ParameterDataTypeModeComment
@fieldnvarchar(128)INThe source field of the logs.translations table: TRANSLATED_NAME, TRANSLATED_DESC, or TRANSLATED_COMMENT.

Editing data requires the SaveToDB Enterprise edition.

logs.usp_translations_change

This procedure updates a database on cell changes of logs.usp_translations.

ParameterDataTypeModeComment
@column_namenvarchar(128)INThe column name of the edited cell (expected logs.translations.LANGUAGE_NAME).
@cell_valuenvarchar(max)INA new value of the edited cell used to update for the source field.
@TABLE_SCHEMAnvarchar(128)INlogs.translations.TABLE_SCHEMA
@TABLE_NAMEnvarchar(128)INlogs.translations.TABLE_NAME
@COLUMNnvarchar(128)INlogs.translations.COLUMN_NAME
@fieldnvarchar(128)INThe source field of the xls.translations table: TRANSLATED_NAME, TRANSLATED_DESC, or TRANSLATED_COMMENT.

logs.xl_actions_clear_logs

This procedure clears change tracking records of the specified target table.

ParameterDataTypeModeComment
@schemanvarchar(128)INTarget table schema
@namenvarchar(128)INTarget table name
@confirmbitIN1 - Clear logs
0 - Cancel
@data_languagechar(2)INThe SaveToDB add-in passes a data language selected in the SaveToDB Options dialog box.
This is a predefined parameter.

A user must also have the UPDATE permission on the target table.

You may run it from the context menu of the logs.view_objects view.

See Creating Change Tracking Triggers.

logs.xl_actions_create_change_tracking_triggers

This procedure creates change tracking triggers of the specified target table.

ParameterDataTypeModeComment
@schemanvarchar(128)INTarget table schema
@namenvarchar(128)INTarget table name
@execute_scriptbitIN1 - Execute scripts to create triggers
@data_languagechar(2)INThe SaveToDB add-in passes a data language selected in the SaveToDB Options dialog box.
This is a predefined parameter.

A user must also have the ALTER permission on the target table.

You may run it from the context menu of the logs.view_objects view.

See Creating Change Tracking Triggers and Triggers.

logs.xl_actions_drop_all_change_tracking_triggers

This procedure drops all change tracking triggers and clears all logs.

ParameterDataTypeModeComment
@schemanvarchar(max)INTarget schema to drop all change tracking triggers or NULL to drop in all schemas
@execute_scriptbitIN1 - Execute scripts to drop triggers

A user must also have the ALTER permission on altered tables.

You may run it from the Actions menu of the logs.view_objects view.

See Useful Operations.

logs.xl_actions_drop_change_tracking_triggers

This procedure drops change tracking triggers of the specified target table.

ParameterDataTypeModeComment
@schemanvarchar(128)INTarget table schema
@namenvarchar(128)INTarget table name
@execute_scriptbitIN1 - Execute scripts to drop triggers
@data_languagechar(2)INThe SaveToDB add-in passes a data language selected in the SaveToDB Options dialog box.
This is a predefined parameter.

A user must also have the ALTER permission on the target table.

You may run it from the context menu of the logs.view_objects view.

See Creating Change Tracking Triggers.

logs.xl_actions_restore_current_record

This procedure restores the current version of the changelog record.

ParameterDataTypeModeComment
@change_idintINChange record ID
@confirmbitIN1 - Restore the record
0 - Print SQL to restore the record

See Restoring Records.

The procedure executes the logs.usp_restore_record procedure with the predefined parameter.

logs.xl_actions_restore_previous_record

This procedure restores the previous version of the changelog record.

ParameterDataTypeModeComment
@change_idintINChange record ID
@confirmbitIN1 - Restore the record
0 - Print SQL to restore the record

See Restoring Records.

The procedure executes the logs.usp_restore_record procedure with the predefined parameter.

logs.xl_actions_restore_record

This procedure restores a row from the changelog record.

ParameterDataTypeModeComment
@change_idintINChange record ID
@restore_previousbitIN1 - Restore the previous record
0 - Restore the current record
@confirmbitIN1 - Restore the record
0 - Print SQL to restore the record
@data_languagechar(2)INThe SaveToDB add-in passes a data language selected in the SaveToDB Options dialog box.
This is a predefined parameter.

A user must have the UPDATE permission on the captured table.

logs.xl_actions_select_lookup_id

This procedure selects rows from tables referenced by foreign keys.

ParameterDataTypeModeComment
@change_idintINChange record ID
@column_namenvarchar(128)INThe column name of the active cell
@namenvarchar(128)INThe name column value
@data_languagechar(2)INThe SaveToDB add-in passes a data language selected in the SaveToDB Options dialog box.
This is a predefined parameter.

See ID Lookup.

A user must have the SELECT permission on the captured and referenced tables.

logs.xl_actions_select_record

This procedure selects change details of a changelog record.

ParameterDataTypeModeComment
@change_idintINChange record ID
@data_languagechar(2)INThe SaveToDB add-in passes a data language selected in the SaveToDB Options dialog box.
This is a predefined parameter.

See Task Panes.

A user must have the SELECT permission on the captured table.

logs.xl_actions_select_records

This procedure selects changelog records.

ParameterDataTypeModeComment
@schemanvarchar(128)INTarget table schema
@namenvarchar(128)INTarget table name
@idintINThe value of the identity column if exists
@keysnvarchar(445)INThe string value of the key columns
@change_typetinyintINNULL - all changes
1 - INSERT
2 - DELETE
3 - UPDATE
@data_languagechar(2)INThe SaveToDB add-in passes a data language selected in the SaveToDB Options dialog box.
This is a predefined parameter.

Generated procedures like dbo25.xl_log_members execute this procedure to select changes.

See Creating Change Tracking Triggers and Task Panes.

A user must have the SELECT permission on the captured table.

logs.xl_actions_set_role_permissions

This procedure sets permissions for the log_administrators and log_users roles.

See Administrator Permissions and See User Permissions.

logs.xl_export_settings

This procedure exports Change Tracking Framework settings.

ParameterDataTypeModeComment
@parttinyintINNULL - all
2 - logs.handlers
3 - logs.translations
4 - logs.formats
5 - logs.workbooks
6 - create triggers
7 - logs.base_tables
@sort_by_namesbitIN1 - sort by names
0 - sort by id (default)
@schemanvarchar(128)INTarget schema to export settings or NULL to export all settings.

Use 'x' to export help for all schemas except doc, logs, and xls.
@languagechar(2)INlogs.translations.LANGUAGE_NAME

Use the 'x' value for the schema to export your database settings only, skipping the framework settings.

logs.xl_import_handlers

This procedure imports Change Tracking Framework settings into logs.handlers.

ParameterDataTypeModeComment
@TABLE_SCHEMAnvarchar(20)INlogs.handlers.TABLE_SCHEMA
@TABLE_NAMEnvarchar(128)INlogs.handlers.TABLE_NAME
@COLUMN_NAMEnvarchar(128)INlogs.handlers.COLUMN_NAME
@EVENT_NAMEvarchar(25)INlogs.handlers.EVENT_NAME
@HANDLER_SCHEMAnvarchar(20)INlogs.handlers.HANDLER_SCHEMA
@HANDLER_NAMEnvarchar(128)INlogs.handlers.HANDLER_NAME
@HANDLER_TYPEnvarchar(25)INlogs.handlers.HANDLER_TYPE
@HANDLER_CODEnvarchar(max)INlogs.handlers.HANDLER_CODE
@TARGET_WORKSHEETnvarchar(128)INlogs.handlers.TARGET_WORKSHEET
@MENU_ORDERintINlogs.handlers.MENU_ORDER
@EDIT_PARAMETERSbitINlogs.handlers.EDIT_PARAMETERS

The procedure is used in the scripts generated by the logs.xl_export_settings procedure.

The procedure tries to update the record first. If the update fails, it inserts a new record.

Functions

FunctionDescription
logs.get_escaped_parameter_nameThis function returns an escaped parameter name.
logs.get_translated_stringThis function returns a translated string.
logs.get_unescaped_parameter_nameThis function returns an unescaped parameter name.

logs.get_escaped_parameter_name

This function returns an escaped parameter name.

ParameterDataTypeComment
Resultnvarchar(255)Escaped parameter name
@namenvarchar(128)Column name

The function converts special characters using the _xHHHH_ format, where HHHH is the hexadecimal character code.

For example, it converts a single quote to _x0027_.

You may use such parameter names in the procedures and handlers that get values from the Excel table columns.
The SaveToDB add-in uses the same conversion function to link columns and parameters.

logs.get_translated_string

This function returns a translated string.

ParameterDataTypeComment
Resultnvarchar(128)The value from the logs.translations table
@stringnvarchar(128)String to translate
@data_languagechar(2)Target language

The function uses the log.translations table to translate strings.

logs.get_unescaped_parameter_name

This function returns an unescaped parameter name.

ParameterDataTypeComment
Resultnvarchar(128)Unescaped column name
@namenvarchar(255)Escaped parameter name

The function converts escaped parameter names with the _xHHHH_ format into the regular column names.

For example, it converts the _x0027_ value to a single quote.

^