From 21bc856d6185b6d0d847b7e9f1d5bc6a4b9f5e40 Mon Sep 17 00:00:00 2001 From: Vladimir Golovchenko Date: Tue, 15 Sep 2020 11:26:57 -0700 Subject: [PATCH] Improved the description of connecting to MS SQL Server by ODBC. --- .../external-dicts-dict-sources.md | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md b/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md index 98f0a5ffb4c..957f2b6ae53 100644 --- a/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md +++ b/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md @@ -246,7 +246,7 @@ Installing unixODBC and the ODBC driver for PostgreSQL: $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql ``` -Configuring `/etc/odbc.ini` (or `~/.odbc.ini`): +Configuring `/etc/odbc.ini` (or `~/.odbc.ini` if you signed in under a user that runs ClickHouse): ``` text [DEFAULT] @@ -321,7 +321,7 @@ You may need to edit `odbc.ini` to specify the full path to the library with the Ubuntu OS. -Installing the driver: : +Installing the ODBC driver for connecting to MS SQL: ``` bash $ sudo apt-get install tdsodbc freetds-bin sqsh @@ -329,7 +329,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh Configuring the driver: -``` bash +```bash $ cat /etc/freetds/freetds.conf ... @@ -339,8 +339,11 @@ Configuring the driver: tds version = 7.0 client charset = UTF-8 + # test TDS connection + $ sqsh -S MSSQL -D database -U user -P password + + $ cat /etc/odbcinst.ini - ... [FreeTDS] Description = FreeTDS @@ -349,8 +352,8 @@ Configuring the driver: FileUsage = 1 UsageCount = 5 - $ cat ~/.odbc.ini - ... + $ cat /etc/odbc.ini + # $ cat ~/.odbc.ini # if you signed in under a user that runs ClickHouse [MSSQL] Description = FreeTDS @@ -360,8 +363,15 @@ Configuring the driver: UID = test PWD = test Port = 1433 + + + # (optional) test ODBC connection (to use isql-tool install the [unixodbc](https://packages.debian.org/sid/unixodbc)-package) + $ isql -v MSSQL "user" "password" ``` +Remarks: +- to determine the earliest TDS version that is supported by a particular SQL Server version, refer to the product documentation or look at [MS-TDS Product Behavior](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/135d0ebe-5c4c-4a94-99bf-1811eccb9f4a) + Configuring the dictionary in ClickHouse: ``` xml