Skip to main content

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:

CapabilityDescription
SQL QueriesExecute read-only SELECT queries against your databases
Log AnalysisSearch and analyze log data stored in SQL Server
Schema ExplorationBrowse databases, tables, and columns
Metrics RetrievalQuery operational metrics and time-series data
note

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​

1
Create a Read-Only User
  1. Connect to your SQL Server instance
  2. 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;
2
Add Integration in Autoheal
  1. Go to Integrations in Autoheal
  2. Click MS SQL Server
  3. Enter a name (e.g., "Production SQL Server")
3
Configure Credentials

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, or disable)
  • Trust Server Certificate: Enable for self-signed certificates (dev/test only)
4
Test and Save

Click Test Connection to check the connection. Then click Save.

Required Permissions​

The SQL Server user should have at least these permissions:

PermissionWhy It's Needed
db_datareaderRead data from all tables
VIEW DATABASE STATEView database metadata
VIEW DEFINITIONBrowse schema and table definitions
tip

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:

ModeDescription
trueEncrypt the connection (recommended for production)
falseUse encryption only if the server requires it
disableNo encryption (not recommended)
warning

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 true and 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