Connect Microsoft SQL Server
Connect Horizon Epoch to Microsoft SQL Server databases.
CLI Configuration
# Add SQL Server storage backend
epoch storage add mydb \
--type mssql \
--url "mssql://user:pass@localhost:1433/database"
Connection String Format
mssql://[user[:password]@][host][:port]/database[?param=value&...]
Common parameters:
encrypt- off, on, requiredtrust_server_certificate- true/falseapplication_name- Application name for logging
Encryption Modes
| Mode | Description |
|---|---|
off | No encryption |
on | Encrypt if server supports it |
required | Require encryption (recommended) |
With Encryption
epoch storage add mydb \
--type mssql \
--url "mssql://user:pass@host/db?encrypt=required"
Trust Self-Signed Certificate
epoch storage add mydb \
--type mssql \
--url "mssql://user:pass@host/db?encrypt=required&trust_server_certificate=true"
Authentication Methods
SQL Server Authentication
epoch storage add mydb \
--type mssql \
--url "mssql://sa:password@localhost/database"
Windows Authentication
epoch storage add mydb \
--type mssql \
--url "mssql://localhost/database?integrated_security=true"
Register Tables
epoch table add customers \
--location "mssql://mydb/dbo.customers"
Azure SQL Database
epoch storage add azure \
--type mssql \
--url "mssql://user@server:pass@server.database.windows.net:1433/database?encrypt=required"
Troubleshooting
Connection Refused
- Verify SQL Server is running and TCP/IP is enabled
- Check SQL Server Configuration Manager for network settings
- Verify firewall allows port 1433
Login Failed
- Verify SQL Server authentication is enabled (mixed mode)
- Check username and password
- Verify user has access to the database
Encryption Errors
- Ensure
encryptsetting matches server configuration - For self-signed certs, use
trust_server_certificate=true