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

# SQL Server integration

> Write Octoparse scraped data to Microsoft SQL Server — Windows or SQL Server authentication and TLS-encrypted connections.

Write scraped data directly into Microsoft SQL Server. Supports Windows authentication and SQL Server account authentication.

***

## Prerequisites

* Octoparse Free plan or above
* A SQL Server instance reachable from Octoparse over the network
* A user account with write permission on the target database
* For Windows authentication: the Octoparse desktop client must run on Windows with SQL Server Native Client 11.0 installed

***

## Configure the export

Fill in the export settings in the following order:

**Configuration name**

Give the config a name so you can reuse it later. The dropdown lets you pick an existing config or type a new name to create one.

**Connection details**

| Field | Description | Default |
| - | - | - |
| Server name | Database host (IP or domain) | — |
| Port | Port number | `1433` |
| Authentication | Authentication method (see below) | — |
| Username | SQL Server account | — |
| Password | Account password | — |
| Encrypt connection | Enable TLS | Off |

**Authentication options:**

| Option | Description | Platform |
| - | - | - |
| SQL Server Authentication | Connect with a database account and password | Windows / macOS |
| Windows Authentication | Connect as the currently signed-in Windows user — no username or password needed | Windows only |

When Windows Authentication is selected, the Username and Password fields are disabled.

> **Encrypt connection:** Azure SQL Database and many managed SQL Server instances require encryption by default — turn this on.

**Database name**

After filling in the connection details, click the Database name dropdown. Octoparse connects and lists the databases (excluding system databases) — pick the target.

**Database Table**

Once a database is selected, pick the target table from the Database Table dropdown. Create the table ahead of time; Octoparse reads its columns for field mapping.

**Test Connection**

Click **Test Connection** to validate the connection, then click **Export** to start.

***

## Write modes

### Append (Insert)

Each export appends new rows to the end of the table without affecting existing data.

### Upsert (Insert or Update)

Decides per row by the primary key you specify: update if the record exists, insert if it doesn't. Designate the primary-key column in field mapping.

***

## Common errors

| Error | Cause | Fix |
| - | - | - |
| `Login failed for user` | Wrong credentials | Re-verify credentials |
| `Cannot open database` | Wrong database name or insufficient permissions | Confirm the database name and account permissions |
| `Connection refused` | Network unreachable or wrong port | Check firewall rules and the SQL Server listening port |
| `SSL connection required` | Server requires encryption but Encrypt connection is off | Turn on Encrypt connection |
| Windows Authentication unavailable | Non-Windows host, or Native Client not installed | Switch to SQL Server Authentication, or install SQL Server Native Client 11.0 |


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