> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeper-connection-manager/supported-protocols/microsoft-sql-server/importing-and-exporting.md).

# Importing and Exporting

Data can be imported to a SQL Server connection from a file on your machine, or exported and downloaded to you machine.

## Import

Import data from a file on your machine into the SQL Server connection.

To import data from a csv file, is the `COPY` command:

```
BULK INSERT <table> FROM LOCAL FILE
```

In the example above, "\<table>" should be replaced with the SQL table to import data into.\
The other parts of the command are required for CSV-formatted files.  If your uploaded file uses different termination characters update the query accordingly.

After running the query, Keeper Connection Manager will prompt you to supply the data file.  To upload the file, simply drag and drop it from your machine onto the browser window.

{% hint style="info" %}
The file uploaded does not have to have the same name given in the query
{% endhint %}

## Export

Data from the connected PostgreSQL database can be exported to a file on your machine.  To do this, use the following query:

```
 SELECT <query> INTO LOCAL OUTFILE "<name>.csv"
```

The result of the given \<query> will be put into a CSV file with the given name and downloaded from the browser to your machine.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keeper.io/keeper-connection-manager/supported-protocols/microsoft-sql-server/importing-and-exporting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
