# export dbt-staging-sql

> Export a data contract to a dbt staging SQL file.

# `datacontract export dbt-staging-sql`

```bash
datacontract export dbt-staging-sql [OPTIONS] [LOCATION]
```

| Argument | Default | Description |
|---|---|---|
| `[LOCATION]` | `datacontract.yaml` | The location (url, s3 url, or local path) of the data contract yaml. |

| Option | Default | Description |
|---|---|---|
| `--output` | — | File path where the exported data will be saved. If not provided, it will be printed to stdout. |
| `--server` | — | The server name to export. |
| `--schema-name` | `all` | Which schema to export, e.g., `orders`, or `all` for all schemas (default). |
| `--json-schema` | — | The location (url or path) of the ODCS JSON Schema. |
| `--inline-references` / `--no-inline-references` | `--inline-references` | Resolve authoritativeDefinitions of type definition, semantics or businessDefinition and inline them into the contract. Relative URLs and semantics IRIs are looked up on the ENTROPY_DATA_HOST (default https://api.entropy-data.com), other URLs are fetched directly, file references are read from disk. See https://cli.datacontract.com/semantics |
| `--debug` / `--no-debug` | — | Enable debug logging |

```bash
datacontract export dbt-staging-sql datacontract.yaml --output stg.sql
```

Guide: **[Export: dbt Staging SQL](../../exports/dbt-staging-sql.md)**.
