Can't create external data source for MongoDB in SQL Server 2022

65 views Asked by At

I'm following the instructions in Configure PolyBase to access external data in MongoDB for SQL Server 2022, and get the following error when creating the external data source:

CREATE EXTERNAL DATA SOURCE mongodb_001
WITH (
      LOCATION = 'mongodb://my.server.name:27030'
     ,CREDENTIAL = mongodb_cred
)

Msg 46530, Level 16, State 11, Line 1
External data sources are not supported with type GENERIC.

I took a look at the page's link for CREATE EXTERNAL DATA SOURCE, however, it doesn't mention a TYPE parameter.

CREATE EXTERNAL DATA SOURCE <data_source_name>
WITH
  ( [ LOCATION = '<prefix>://<path>[:<port>]' ]
    [ [ , ] CONNECTION_OPTIONS = '<key_value_pairs>'[,...]]
    [ [ , ] CREDENTIAL = <credential_name> ]
    [ [ , ] PUSHDOWN = { ON | OFF } ]
  )
[ ; ]

I do see that SQL Server 2016 required the TYPE parameter, and that they say to check the specific syntax for your SQL Server version. We are on a 2022 evaluation version (see below for the full version info), and the above command was copied from the above link, so I think I have the up-to-date format.

Microsoft SQL Server 2022 (RTM) - 16.0.1000.6 (X64)   Oct  8 2022 05:58:25   Copyright (C) 2022 Microsoft Corporation  Enterprise Evaluation Edition (64-bit) on Windows Server 2016 Standard Evaluation 10.0 <X64> (Build 14393: )

Also, I verified that PolyBase is installed:

SELECT SERVERPROPERTY ('IsPolyBaseInstalled') AS IsPolyBaseInstalled; 
returns 1

What am I missing?

1

There are 1 answers

0
Alan On

Ugh... finally ran across this post where they said that even though the IsPolyBaseInstalled query may return 1, you need to do this:

exec sp_configure @configname = 'polybase enabled', @configvalue = 1;

followed by:

RECONFIGURE

Once I did that, I was able to create the external data source.