---
title: "Creating a Microsoft SQL Device"
description: "Configure a connection to a Microsoft SQL database"
source_url: https://ai-ops.com/docs/devices/creating-mssql
---

# Creating a Microsoft SQL Device

After [creating a device](https://ai-ops.com/docs/devices/creating-getting-started.md) with the **Microsoft SQL** protocol, you'll land on its **Configuration** tab. This is where you provide the connection details Koios needs to query your SQL Server database.

> [!NOTE] SQL devices are for reading data
> Microsoft SQL devices allow Koios to query data from SQL Server databases at a regular scan interval. Each tag on an SQL device executes a SQL query and stores the result as a live value. This is useful for pulling data from business systems, historians, or other databases into the Koios platform.

## Configuration Fields

### Database Driver

The ODBC driver used to connect to SQL Server. Select the driver that matches what's installed on the Koios server.

| Driver | Description |
|--------|-------------|
| **ODBC Driver 18 for SQL Server** | Latest driver with improved security defaults |

- **Required**

> [!WARNING] Driver must be installed on the server
> The selected driver must be installed on the machine (or container) running the Koios datacollector service. If you're unsure which drivers are available, check with your system administrator.

### Hostname / Server

The hostname or IP address of the SQL Server instance.

- **Required**
- Example: `192.168.1.100` or `sqlserver.local`

### Database Name

The name of the database to connect to on the SQL Server instance.

- **Required**
- Example: `mydb`

### Username

The SQL Server login used to authenticate.

- **Required**

### Password

The password for the SQL Server login.

- **Required**

### Timeout (seconds)

How long Koios waits for the database to respond before giving up.

- **Default:** 10 seconds
- **Minimum:** 1 second
- **Maximum:** 300 seconds (5 minutes)

Database queries may take longer than typical device reads, especially for complex queries or large datasets. The default of 10 seconds is appropriate for most use cases.

## After Configuration

Once you've filled in the connection settings:

1. **Save** the configuration
2. **Add tags** — each tag defines a SQL query to execute (see [Creating a Microsoft SQL Tag](https://ai-ops.com/docs/tags/creating-mssql.md))
3. **Enable the device** — flip the enable switch to start querying

> [!TIP] Scan rate for SQL devices
> SQL queries consume database resources on every scan cycle. Consider using a longer scan rate (30–300 seconds) for SQL devices unless you need near-real-time data. You can configure the scan rate on the device's general configuration section or when [creating the device](https://ai-ops.com/docs/devices/creating-getting-started.md).
