From bbe7af4dca71a9ed6ce315726ecaee9babdc5442 Mon Sep 17 00:00:00 2001 From: datafx Date: Fri, 20 Dec 2019 09:36:27 -0500 Subject: [PATCH] Update MS SQL Server documentation with info on ODBC Drivers (#11505) * Update MS SQL Server info corrected db_url and added notes about odbc driver requirements. * Fix punctuation --- source/_integrations/recorder.markdown | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/_integrations/recorder.markdown b/source/_integrations/recorder.markdown index 049aac26927..875d26c90e0 100644 --- a/source/_integrations/recorder.markdown +++ b/source/_integrations/recorder.markdown @@ -138,7 +138,7 @@ Call the service `recorder.purge` to start a purge task which deletes events and | PostgreSQL | `postgresql://SERVER_IP/DB_NAME` | | PostgreSQL | `postgresql://user:password@SERVER_IP/DB_NAME` | | PostgreSQL (Socket) | `postgresql://@/DB_NAME` | -| MS SQL Server | `mssql+pyodbc://username:password@dsnname` | +| MS SQL Server | `mssql+pyodbc://username:password@SERVER_IP/DB_NAME?charset=utf8;DRIVER={DRIVER};Port=1433;` |
@@ -247,7 +247,7 @@ A service restart will work as well. ### MS SQL Server -For MS SQL Server you may have to install a few dependencies: +For MS SQL Server you will have to install a few dependencies: ```bash sudo apt-get install unixodbc-dev @@ -261,3 +261,11 @@ sudo -u homeassistant -H -s source /srv/homeassistant/bin/activate pip3 install pyodbc ``` + +You will also need to install an ODBC Driver. Microsoft ODBC drivers are recommended, however FreeTDS is available for systems that are not supported by Microsoft. Instrucitons for installing the Microsoft ODBC drivers can be found [here](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server). + +
+ +If you are using Hass.io, FreeTDS is already installed for you. The db_url you need to use is `mssql+pyodbc://username:password@SERVER_IP/DB_NAME?charset=utf8;DRIVER={FreeTDS};Port=1433;`. + +