Redigera

Dela via


.alter table policy update command

Applies to: ✅ Microsoft FabricAzure Data Explorer

Use this command to change the table update policy. The update policy simplifies the process of syncing and updating data between two tables. When new data is inserted into the source table, a transformation query runs over this data to modify and insert the data into the target table.

Note

The source table and the table for which the update policy is defined must be in the same database. The update policy function schema and the target table schema must match in their column names, types, and order.

Permissions

You must have at least Table Admin permissions to run this command.

Syntax

.alter table [ DatabaseName.]TableName policy update ArrayOfPolicyObjects

Learn more about syntax conventions.

Parameters

Name Type Required Description
DatabaseName string The name of the database. If you run the command from a database context that doesn't contain the specified table, then this parameter is required.
TableName string ✔️ The name of the table.
ArrayOfPolicyObjects string ✔️ A serialized array of policy objects. For more information, see update policy.

Returns

Returns a JSON representation of the policy.

Example

Change the update policy for a table (using multi-line string literals):

.alter table MyDatabase.MyTable policy update
```
[
    {
        "IsEnabled": true,
        "Source": "MyTableX",
        "Query": "MyOtherTable",
        "IsTransactional": true,
        "PropagateIngestionProperties": false
    }
]
```