MS SQL connection

Host
Database
  • SQL Server Authentication This is the default mechanism to connect to MS SQL Server. Enter the SQL Server Authentication login or the Windows Authentication login in the DOMAIN\User format.
  • Windows Authentication Windows Integrated Security - single sign on for users who are already logged onto Windows and have enabled this option for MS SQL Server.
User

TLS/SSL Auth

Determines whether or to which extent a secure SSL TCP/IP connection will be negotiated with the server.
  • disable - Data sent between client and server is not encrypted.
  • false - Data sent between client and server is not encrypted beyond the login packet. (default)
  • true - Data sent between client and server is encrypted.
If you're using an older version of Microsoft SQL Server like 2008 and 2008R2 you may need to disable encryption to be able to connect.
TLS/SSL Root Certificate Path to file containing the public key certificate of the CA that signed the SQL Server certificate. Needed when the server certificate is self signed.
Hostname in server certificate Specifies the Common Name (CN) in the server certificate. Default is the server host.

Connection limits

Max open The maximum number of open connections to the database. If Max idle connections is greater than 0 and the Max open connections is less than Max idle connections, then Max idle connections will be reduced to match the Max open connections limit. If set to 0, there is no limit on the number of open connections.
Max idle The maximum number of connections in the idle connection pool. If Max open connections is greater than 0 but less than the Max idle connections, then the Max idle connections will be reduced to match the Max open connections limit. If set to 0, no idle connections are retained.
Max lifetime The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever.

MS SQL details

Min time interval A lower limit for the auto group by time interval. Recommended to be set to write frequency, for example 1m if your data is written every minute.
User Permission

The database user should only be granted SELECT permissions on the specified database and tables you want to query. Grafana does not validate that queries are safe so queries can contain any SQL statement. For example, statements like USE otherdb; and DROP TABLE user; would be executed. To protect against this we highly recommmend you create a specific MS SQL user with restricted permissions.