MS SQL Server Integration
Connect Microsoft SQL Server to enable the AI agent to query logs, metrics, and operational data stored in your SQL Server databases during investigations.
Capabilities
Once connected, the AI agent 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. UPDATE, DELETE, INSERT, and other data-modifying commands are blocked 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 verify, then 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
Once connected, you can ask the AI 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
- Verify the server hostname and port are correct
- Check that SQL Server is running and accepting TCP/IP connections
- Ensure firewall rules allow connections from Autoheal
- Verify SQL Server Browser service is running (for named instances)
Login Failed
- Verify the username and password are correct
- Check that SQL Server authentication mode includes SQL authentication
- Ensure the login is not locked or disabled
SSL/TLS Errors
- Try setting Encryption to
trueand enabling Trust Server Certificate - Verify the server certificate is valid if not trusting self-signed certs
- Check that the server supports TLS 1.2 or higher