SQL add text on pyodbc for MSSQL (#24748)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
G Johansson 2022-11-29 13:04:34 +01:00 committed by GitHub
parent 54ba22457e
commit 596c8432b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"`
<div class='note info'>
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
</div>
```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';
```