Skip to Content

MSSQL Linked Server with HANA data type error

Mar 02, 2017 at 08:58 AM


avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Luis Darui
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
10 |10000 characters needed characters left characters exceeded