> For the complete documentation index, see [llms.txt](https://docs.langstack.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.langstack.com/welcome/in-depth-learning/connectors/ms-sql-connector/ms-sql-connector-as-reader-and-writer.md).

# MS-SQL connector as Reader and Writer

## MSSQL Connector as a Reader

The MSSQL Connector as a `Reader` reads from the field defined in `Reader>Source` fields once the `Reader stream` is selected.

## MSSQL Connector as a Writer

The MSSQL Connector as a `Writer` performs the writing according to the field mapping and the `Writer mode`.&#x20;

![](/files/HNTZg42ay5YjDOj0jgfv)

The `Writer mode` allows the user to define the data to be written in one of the following ways:

1. `Append`: This setting defines that the data in the source will be added to the destination without affecting the existing data in the destination. This option is selected by default.
2. `Add & Update`: This setting defines that if a record is not present according to the match key, the record should be added, and the destination data set is updated accordingly. If the record is found, then the record is updated.
3. `Delete`: This setting defines that according to the match key, data is deleted from the destination data source.
4. `Sync` (Synchronize): This setting defines that data is synchronized between source and destination according to the match key. \
   For example, if a record is present in the source file and not in the target destination, the target destination is updated to sync with the source file. Similarly, if a record is not present in the source file and is present in the target destination, the same record in the target destination will be deleted.

![](/files/MGzyLNW9gDiaf3dGyVxL)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.langstack.com/welcome/in-depth-learning/connectors/ms-sql-connector/ms-sql-connector-as-reader-and-writer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
