Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert string to varchar error on mssql linked server #435

Open
turgaysargin opened this issue Nov 28, 2023 · 0 comments
Open

Convert string to varchar error on mssql linked server #435

turgaysargin opened this issue Nov 28, 2023 · 0 comments

Comments

@turgaysargin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant