From 596c8432b5224adf8ae8df68d99eccbfb208f631 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Tue, 29 Nov 2022 13:04:34 +0100 Subject: [PATCH] SQL add text on pyodbc for MSSQL (#24748) Co-authored-by: Franck Nijhof --- source/_integrations/sql.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/_integrations/sql.markdown b/source/_integrations/sql.markdown index 02d301b42ad..59e453c34fd 100644 --- a/source/_integrations/sql.markdown +++ b/source/_integrations/sql.markdown @@ -95,6 +95,12 @@ Use the same Database URL as for the `recorder` integration. Change `DB_NAME` to Example Database URL: `"mssql+pyodbc://username:password@SERVER_IP:1433/DB_NAME?charset=utf8&driver=FreeTDS"` +
+Connecting with MSSQL requires "pyodbc" to be installed on your system, which can only be done on systems using the Home Assistant Core installation type to be able to install the necessary dependencies. + +"pyodbc" has special requirements which need to be pre-installed before installation, see the ["pyodbc" wiki](https://github.com/mkleehammer/pyodbc/wiki/Install) for installation instructions +
+ ```sql SELECT TOP 1 SUM(m.size) * 8 / 1024 as size FROM sys.master_files m INNER JOIN sys.databases d ON d.database_id=m.database_id WHERE d.name='DB_NAME'; ```