ClickHouse / clickhouse-odbc

ODBC driver for ClickHouse

Home Page:https://clickhouse.tech

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convert string to varchar error on mssql linked server

turgaysargin opened this issue · comments

Hi,

I downloaded your windows odbc driver from here: https://github.com/ClickHouse/clickhouse-odbc/releases/download/v1.2.1.20220905/clickhouse-odbc-windows.zip

I created linked server on Mssql server using sql server management studion on windows as linked to clickhouse. I run select query on linked server bu I can't get string value. Because mssql server support max 4000 character of string.
I get this error:

"OLE DB provider "MSDASQL" for linked server "CLIKHOUSELINKEDSERVER" returned message "Requested conversion is not supported"
Cannot get the current row value of column "[MSDASQL].Column Name" from OLE DB provider "MSDASQL" for linked server CLIKHOUSELINKEDSERVER".

I want to limit the string value to 4000 characters.
I can get response using this query: SELECT * FROM OPENQUERY([CLICKHOUSEDEMO], 'SELECT toFixedString(namesurname, 100) as namesurname FROM tableCH')

But, I don't want to use toFixedString function. I want to use this query: SELECT namesurname FROM tableCH.

Can I change odbc code to solve this topic and how? Please help me. Thanks.