> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Copy

> COPY ... TO: writing a query result to object storage as files.

> [!WARNING]
>
> Recent deployment versions refuse `COPY` over the SQL endpoint with "COPY is not
> supported". On those, export a result by reading it through a Flight SQL client
> or an SDK and writing the files from your application.

```sql SQL icon="database" theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
COPY (SELECT id, title FROM documents) TO 's3://bucket/export/' STORED AS PARQUET
```

Writes a query result to object storage. This is the export path when the
consumer is another engine rather than an application: results land as files
rather than streaming to a client.

## What to read next

> [card] [Insert](https://docs.lancedb.com/sql/dml/insert.md)
>
> Bringing rows in, rather than exporting them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.