**Source URL:** https://limited.veevavault.dev/medical/vault-dx/dx-reference/command-reference/mdl

# vault mdl

Execute an MDL statement directly against the connected Vault.

## Usage

```sh
vault mdl <STATEMENT> [--dns <DNS>]
```

## Options

| Option | Type | Required | Description |
| --- | --- | --- | --- |
| `<STATEMENT>` | string | Required | The MDL statement to execute, enclosed in quotes |
| `--dns <DNS>` | string | Optional | Vault DNS to run against (default: the active vault) |

This command also accepts the [global options](/vault-dx/vault-dx/vault-dx/dx-reference/command-reference/global-options/).

## Examples

#### Execute from a file (macOS / Linux)

```sh
vault mdl "$(cat components/Picklist/color.mdl)"
```

#### Execute from a file (Windows PowerShell)

```powershell
vault mdl (Get-Content -Raw components/Picklist/color.mdl)
```

Note: `vault mdl` does not read from stdin. Passing the file content as a string argument works on all platforms.

#### Create a picklist

```sh
vault mdl "CREATE Picklist color__c (label('Color') active(true))"
```

#### Recreate a picklist with new values

```sh
vault mdl "RECREATE Picklist color__c (label('Color') active(true) ENTRY red__c (label('Red') active(true)) ENTRY blue__c (label('Blue') active(true)))"
```

#### Drop a component

```sh
vault mdl "DROP Picklist old_status__c"
```

## Output

Single statement, no warnings:

```
Executing MDL...
SUCCESS MDL executed.
```

Multi-statement script:

```
Executing MDL...
[1] SUCCESS  CREATE Picklist.color__c
[2] SUCCESS  DROP Picklist.old__c
SUCCESS MDL executed.
```

Statements with warnings produce `MDL executed with warnings.` instead of `SUCCESS MDL executed.`

If a statement fails, the CLI reports every statement's outcome, not only the failing one. MDL scripts are not transactional: earlier successful statements are not rolled back on failure.

For MDL syntax, see the [MDL reference](https://general.veevavault.dev/platform/mdl/).