Skip to content

Commit 4e4c41a

Browse files
Merge pull request #2754 from MicrosoftDocs/main638954713679174606sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 8c560c9 + a680547 commit 4e4c41a

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

data-explorer/kusto/management/execute-database-script.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ ms.reviewer: alexans
55
ms.topic: reference
66
ms.date: 08/26/2024
77
---
8-
# .execute database script command
8+
# `.execute database script` command
99

1010
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]
1111
1212
Executes a batch of management commands in the scope of a single database.
1313

1414
> [!NOTE]
15-
> Select the full command text before running it. Otherwise, it will stop at the first empty line in the script.
15+
> Select the full command text before running it. Otherwise, it stops at the first empty line in the script.
16+
17+
> [!TIP]
18+
> By default, the `.execute database script` command always succeeds. If you want the command to fail when one of the commands in the script fails, run the command with the `ThrowOnErrors` property set to `True`. For example: `.execute database script with (ThrowOnErrors=true)`.
1619
1720
## Permissions
1821

@@ -24,7 +27,7 @@ You must have at least [Database Admin](../access-control/role-based-access-cont
2427
[`with` `(` *PropertyName* `=` *PropertyValue* [`,` ...]`)`] `<|` *ControlCommandsScript*
2528

2629
[!INCLUDE [syntax-conventions-note](../includes/syntax-conventions-note.md)]
27-
30+
https://microsoft-ce-csi.acrolinx.cloud/htmldata/en/rules/6fba4c0492df38150ba70881e2fae9640d6466a0.html
2831
## Parameters
2932

3033
|Name|Type|Required|Description|
@@ -53,10 +56,10 @@ Each command appearing in the script is reported as a separate record in the out
5356

5457
>[!NOTE]
5558
>
56-
>* The script text may include empty lines and comments between the commands.
59+
>* The script text can include empty lines and comments between the commands.
5760
>* Commands are executed sequentially, in the order they appear in the input script.
58-
>* Script execution is sequential, but non-transactional, and no rollback is performed upon error. It's advised to use the idempotent form of commands when using `.execute database script`.
59-
>* Execution of the command requires Database Admin permissions, in addition to permissions that may be required by each specific command.
61+
>* Script execution is sequential, but non-transactional, and no rollback is performed upon error. We recommend that you use the idempotent form of commands when using `.execute database script`.
62+
>* Execution of the command requires Database Admin permissions, in addition to the permissions required by each specific command.
6063
>* Default behavior of the command - fail on the first error, it can be changed using property argument.
6164
>* Read-only management commands (`.show` commands) aren't executed and are reported with status `Skipped`.
6265
@@ -96,6 +99,6 @@ The following example executes a script with multiple operations, continuing to
9699

97100
|OperationId|CommandType|CommandText|Result|Reason|
98101
|---|---|---|---|---|
99-
|1d28531b-58c8-4023-a5d3-16fa73c06cfa|TableCreate|.create-merge table T(a:string, b:string)|Completed||
100-
|67d0ea69-baa4-419a-93d3-234c03834360|RetentionPolicyAlter|.alter-merge table T policy retention softdelete = 10d|Completed||
101-
|0b0e8769-d4e8-4ff9-adae-071e52a650c7|FunctionCreateOrAlter|.create-or-alter function with (skipvalidation = "true")SampleT1(myLimit: long) {T1 \| take myLimit}|Completed||
102+
|1d28531b-58c8-4023-a5d3-16fa73c06cfa|TableCreate|`.create-merge table T(a:string, b:string)`|Completed||
103+
|67d0ea69-baa4-419a-93d3-234c03834360|RetentionPolicyAlter|`.alter-merge table T policy retention softdelete = 10d`|Completed||
104+
|0b0e8769-d4e8-4ff9-adae-071e52a650c7|FunctionCreateOrAlter|`.create-or-alter function with (skipvalidation = "true")SampleT1(myLimit: long) {T1 \| take myLimit}`|Completed||

0 commit comments

Comments
 (0)