How to fix Error 5374 on Windows Server 2025 / Windows 11

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, or OPENROWSET statement.
  • Note the LOCATION connector prefix (e.g., odbc://, s3://, https://) and the FORMAT_TYPE or FORMAT value specified in the WITH clause.
  • 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 WITH clause entirely from the LOCATION definition if the connector does not support inline formatting options.
  • Move format-specific settings (such as FIELDTERMINATOR, ROWTERMINATOR, or DATA_COMPRESSION) into a separate CREATE EXTERNAL FILE FORMAT object instead of inline in the WITH clause.
  • 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 Configuration and confirm PolyBase services are running under Services.msc as SQL Server PolyBase Engine and SQL 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 by RECONFIGURE; to ensure PolyBase features are active.
  • Re-create the EXTERNAL DATA SOURCE object explicitly specifying CONNECTION_OPTIONS compatible 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 TABLE statement in a new query window to confirm the parser accepts the revised syntax.

Alternative or Verification Steps

  • Verify the fix by querying sys.external_tables and sys.external_file_formats to 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 standalone FORMAT_OPTIONS clause instead of a connector-specific WITH clause, which bypasses the stricter validation path entirely for ad hoc queries.