MS SQL Server Integration
Connect Microsoft SQL Server so that agents can query logs, metrics, and operational data stored in your SQL Server databases during investigations.
Capabilities
After you connect SQL Server, agents can:
| Capability | Description |
|---|---|
| SQL Queries | Execute read-only SELECT queries against your databases |
| Log Analysis | Search and analyze log data stored in SQL Server |
| Schema Exploration | Browse databases, tables, and columns |
| Metrics Retrieval | Query operational metrics and time-series data |
Read-only access: This integration only executes SELECT queries. The integration blocks UPDATE, DELETE, INSERT, and other data-modifying commands at the query level.
Prerequisites
- A Microsoft SQL Server instance (2016 or later recommended)
- A SQL Server user account with read permissions
- Network connectivity between Autoheal and your SQL Server instance
Setup
- Connect to your SQL Server instance
- Create a dedicated user for Autoheal:
CREATE LOGIN autoheal_reader WITH PASSWORD = 'your_secure_password';
USE your_database;
CREATE USER autoheal_reader FOR LOGIN autoheal_reader;
ALTER ROLE db_datareader ADD MEMBER autoheal_reader;
- Go to Integrations in Autoheal
- Click MS SQL Server
- Enter a name (e.g., "Production SQL Server")
Enter the following:
- Server: SQL Server hostname or IP address (e.g.,
sql-server.example.com) - Port: SQL Server port (default:
1433) - Database: Database name to connect to
- Username: SQL Server username
- Password: SQL Server password
- Encryption: Connection encryption mode (
true,false, ordisable) - Trust Server Certificate: Enable for self-signed certificates (dev/test only)
Click Test Connection to check the connection. Then click Save.
Required Permissions
The SQL Server user should have at least these permissions:
| Permission | Why It's Needed |
|---|---|
db_datareader | Read data from all tables |
VIEW DATABASE STATE | View database metadata |
VIEW DEFINITION | Browse schema and table definitions |
Create a dedicated SQL login for Autoheal with only read permissions. Never use sa or admin accounts.
SSL/Encryption Modes
Select the appropriate encryption mode for your environment:
| Mode | Description |
|---|---|
true | Encrypt the connection (recommended for production) |
false | Use encryption only if the server requires it |
disable | No encryption (not recommended) |
Only enable Trust Server Certificate in development or testing environments. In production, use properly signed certificates.
Example Queries
After you connect SQL Server, you can ask an agent questions like:
Show me errors from the application_logs table in the last hour
Query the metrics table for CPU usage trends today
What tables exist in the operations database?
Find the most recent failed transactions in the payments table
Troubleshooting
Connection Refused
- Check that the server hostname and port are correct
- Check that SQL Server is running and accepting TCP/IP connections
- Check that firewall rules allow connections from Autoheal
- Check that the SQL Server Browser service is running (for named instances)
Login Failed
- Check that the username and password are correct
- Check that SQL Server authentication mode includes SQL authentication
- Check that the login is not locked or disabled
SSL/TLS Errors
- Try setting Encryption to
trueand enabling Trust Server Certificate - If you do not trust self-signed certificates, check that the server certificate is valid
- Check that the server supports TLS 1.2 or higher