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

Troubleshooting Guide: SQL Server Error 491 – Missing Correlation Name for Bulk Rowset

Why This Error Happens

This error occurs when a BULK INSERT or OPENROWSET(BULK...) statement is used in a FROM clause without an assigned table alias (correlation name). SQL Server 2025 requires an explicit alias for bulk rowset providers because the engine cannot implicitly reference the derived table structure returned by the bulk operation. This is a T-SQL syntax requirement rather than a permissions or configuration issue, though it commonly surfaces after migrating scripts from older SQL Server versions or third-party ETL tools that used looser syntax parsing.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your Windows Server 2025/Windows 11 instance.
  • Locate the exact query referenced in the error log or job history (check SQL Server Agent > Job History if this ran as a scheduled task).
  • Look specifically for OPENROWSET(BULK '...', ...) or BULK INSERT statements used inline within a SELECT ... FROM clause.

Step 2: Add a Correlation Name (Alias)

  • Modify the query to append an alias immediately after the closing parenthesis of the OPENROWSET or bulk rowset function.
  • Example of the broken syntax:
  SELECT * FROM OPENROWSET(BULK 'C:\Data\import.csv', SINGLE_CLOB) 
  • Corrected syntax with alias:
  SELECT * FROM OPENROWSET(BULK 'C:\Data\import.csv', SINGLE_CLOB) AS BulkData
  • If using BULK INSERT with FORMATFILE or CSV options, ensure the derived rowset also carries an alias when nested in a subquery.

Step 3: Validate File Path and Import Permissions

  • Confirm the file path (e.g., C:\Data\import.csv) is accessible by the SQL Server service account, not just your Windows user account.
  • Check permissions via File Explorer > Properties > Security tab, ensuring the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER) has at least Read access.
  • Re-run the corrected query to confirm the syntax error (491) is resolved and no permission-related errors (Error 4861) appear instead.

Step 4: Update Linked ETL Scripts or Stored Procedures

  • Search all stored procedures, SSIS packages, or PowerShell automation scripts for legacy OPENROWSET(BULK...) calls missing aliases.
  • Use sp_helptext or a script search tool to locate all instances:
  EXEC sp_helptext 'YourStoredProcedureName';
  • Apply the same alias fix (AS <CorrelationName>) consistently across all affected objects.

Alternative or Verification Steps

  • Re-execute the corrected query in SSMS; a successful result set with no Error 491 confirms the fix.
  • If the error persists in a stored procedure, run sp_recompile 'ProcedureName' to clear any cached execution plans referencing the old syntax.