Troubleshooting Guide: SQL Server Error 5374 – WITH Clause Not Supported for Connector/Format Combination
Why This Error Happens
This error occurs when SQL Server 2025’s PolyBase or External Data Source engine parses a CREATE EXTERNAL TABLE or OPENROWSET statement containing a WITH clause that specifies options incompatible with the target connector (e.g., ODBC, GENERIC, or S3) and format (e.g., PARQUET, DELTA, or CSV) combination. Certain connectors restrict which WITH options—such as DATA_SOURCE, FILE_FORMAT, or LOCATION—can be paired with specific file formats, and the engine enforces this validation strictly at parse time. This typically happens after a migration or script reuse from an older SQL Server version where the connector/format pairing rules were more permissive or different.
Step-by-Step Resolution Guide
Step 1: Identify the Exact Connector and Format Combination
- Open the failing script and locate the
CREATE EXTERNAL TABLE,CREATE EXTERNAL DATA SOURCE, orOPENROWSETstatement. - Note the
LOCATIONconnector prefix (e.g.,odbc://,s3://,https://) and theFORMAT_TYPEorFORMATvalue specified in theWITHclause. - Cross-reference both values against the official Microsoft documentation table for SQL Server 2025 PolyBase connector/format support matrix.
Step 2: Remove or Relocate Unsupported WITH Clause Options
- Strip out the
WITHclause entirely from theLOCATIONdefinition if the connector does not support inline formatting options. - Move format-specific settings (such as
FIELDTERMINATOR,ROWTERMINATOR, orDATA_COMPRESSION) into a separateCREATE EXTERNAL FILE FORMATobject instead of inline in theWITHclause. - Example corrected syntax:
CREATE EXTERNAL FILE FORMAT MyParquetFormat
WITH (FORMAT_TYPE = PARQUET);
CREATE EXTERNAL TABLE MyTable (...)
WITH (LOCATION = 'odbc://server/path', FILE_FORMAT = MyParquetFormat);
Step 3: Update PolyBase Connectivity Configuration
- Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
- Navigate to
SQL Server Network Configurationand confirm PolyBase services are running underServices.mscasSQL Server PolyBase EngineandSQL Server PolyBase Data Movement. - Restart both services after any configuration file changes located at
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn\Polybase\Settings\.
Step 4: Validate External Data Source Definition
- Run
sp_configure 'polybase enabled', 1;followed byRECONFIGURE;to ensure PolyBase features are active. - Re-create the
EXTERNAL DATA SOURCEobject explicitly specifyingCONNECTION_OPTIONScompatible with the chosen format, avoiding deprecated syntax from SQL Server 2019/2022 scripts.
Step 5: Re-run the Query in a Clean Session
- Disconnect and reconnect via SQL Server Management Studio (SSMS) 21 to clear cached metadata.
- Execute the corrected
CREATE EXTERNAL TABLEstatement in a new query window to confirm the parser accepts the revised syntax.
Alternative or Verification Steps
- Verify the fix by querying
sys.external_tablesandsys.external_file_formatsto confirm the object was created without errors and metadata reflects the correct format type. - If the error persists, as an alternative, use
OPENROWSET(BULK...)with a standaloneFORMAT_OPTIONSclause instead of a connector-specificWITHclause, which bypasses the stricter validation path entirely for ad hoc queries.