# Export: dbt Staging SQL

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

#  Export: dbt Staging SQL

Generates a dbt staging SQL file that selects the contract's fields.

{/* AUTOGENERATED EXAMPLE: do not edit by hand; regenerate with the update script. */}

```bash
datacontract export dbt-staging-sql orders.odcs.yaml --schema-name orders
```

Running this against the [example `orders` contract](https://github.com/datacontract/datacontract-cli/blob/main/examples/orders/orders.odcs.yaml) produces:

```sql
    select
        order_id, order_timestamp, customer_id, order_total, status
    from {{ source('urn:datacontract:checkout:orders', 'orders') }}
```

{/* END AUTOGENERATED EXAMPLE */}

For fully customized staging models, use the [`custom`](./custom.md) exporter with a Jinja template.

All options: **[`datacontract export dbt-staging-sql`](../commands/export/dbt-staging-sql.md)**.
