0

I'm using a Linked server from SQL Server 2012 to connect to MongoDB via BI Connector ( MongoDB Atlas ).

I can retrieve some info that is int for example, but when running the query below, I receive an error:

select * from openquery([MONGO],'select * from address')

OLE DB provider "MSDASQL" for linked server "MONGO" returned message "Requested conversion is not supported.".

Msg 7341, Level 16, State 2, Line 1 Cannot get the current row value of column "[MSDASQL]._id" from OLE DB provider "MSDASQL" for linked server "MONGO".

I tried everything and I read every post about this issue on the internet with no success. I tried to cast, I tried "allow in process" inside the linked server but it seems I cant retrieve data from mongoDB.

as I read on google, this is because is the MongoDB ODBC driver is correctly describing some MongoDB data to SQL Server as an NVARCHAR(n), but n is greater than the maximum length that SQL Server supports for this data type, so I should use the Schema Editor to change the length for this column to 4000.

theres something calloed mongosqld for MySQL, and there I can set :

SET GLOBAL mongodb_max_varchar_length = X

but where can I find this on SQL Server?

Racer SQL
  • 7,004
  • 9
  • 49
  • 101
  • I thought mongosqld was the file name for the BI Connector executable? – Joe Aug 21 '20 at 03:44
  • I really don't know, I just activated it on MongoDB Atlas panel and I created a linked server. I could fix the error by unchecking "allow in process" on sql server, but performance is horible and if it fails, it takes down the entire sql server instance. – Racer SQL Aug 21 '20 at 12:30

0 Answers0