Skip to Content
author's profile photo
Former Member

MSSQL Linked Server with HANA data type error

Hello everybody,

I successfully managed to use Linked Server function from SQL Server Management Studio to link MSSQL Server with HANA Server.

The problem is when I try to select multiple values from a table/view and in these values a NCLOB data type from HANA is include there is an SQL error saying

"Error converting data type DBTYPE_DBTIMESTAMP to datetime2."

but when I select this value alone there is no problem. I tried to cast NCLOB value as nvarchar(max) with no success.

What can I do to fix this problem?

Kind regards,

Dimitris Theotokatos

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Posted on Mar 03, 2017 at 05:11 PM

    Hi Dimitris,

    Personally I never used SQL Server linked servers this way. But I believe it is possible to.

    The CLOB and NCLOB types do not exist under this name on SQL Server. Their equivalent on SQL Server TEXT/VARCHAR and NTEXT/NVARCHAR. This might help you to figure it out:

    You have to explicitly convert it, because SQL Server cannot do it. /Example:

    SELECT CAST(nclobcolumn as nvarchar(max)) as NCLOBCOLUMN from table
    Add comment
    10|10000 characters needed characters exceeded