Troubleshooting Guide: Error 4890 — “INSERT BULK is not supported in showplan mode”
Why This Error Happens
This error occurs when a client application or session attempts to execute a BULK INSERT or INSERT ... SELECT * FROM OPENROWSET(BULK...) statement while SHOWPLAN_ALL, SHOWPLAN_XML, or SHOWPLAN_TEXT is enabled on the connection. SQL Server 2025’s query optimizer cannot generate a graphical or textual execution plan for bulk import operations because they bypass the standard query processor and use the bulk load API directly. This typically happens when a tool like SQL Server Management Studio (SSMS) has “Display Estimated Execution Plan” or “Include Actual Execution Plan” toggled on, or when a session-level SET SHOWPLAN_XML ON statement was left active from a previous script.
Step-by-Step Resolution Guide
Step 1: Disable Showplan Options in Your Client Tool
- Open SSMS or Azure Data Studio and check the toolbar for the “Include Actual Execution Plan” icon (Ctrl+M) — ensure it is toggled OFF.
- Also disable “Display Estimated Execution Plan” (Ctrl+L) before running the
BULK INSERTscript. - If using
sqlcmdor a custom application, confirm no startup script is injecting showplan flags.
Step 2: Reset Session-Level SET Options
- At the top of your query window, explicitly reset any lingering showplan settings before executing the bulk operation:
SET SHOWPLAN_XML OFF;
GO
SET SHOWPLAN_ALL OFF;
GO
SET SHOWPLAN_TEXT OFF;
GO
- Run this in a fresh query window to rule out session state carried over from a prior connection pool reuse.
Step 3: Isolate the BULK INSERT in a Separate Batch
- Place your
BULK INSERTorOPENROWSET(BULK...)statement in its own batch, separated byGO, so no priorSETstatement in the same batch affects it. - Example:
BULK INSERT dbo.TargetTable
FROM 'C:\ImportData\datafile.csv'
WITH (FORMAT = 'CSV', FIRSTROW = 2, TABLOCK);
GO
- Confirm the file path is accessible to the SQL Server service account (check
NT SERVICE\MSSQLSERVERpermissions on the folder under Windows Server 2025 / Windows 11).
Step 4: Check for Linked/Automated Job Interference
- If the error surfaces inside a SQL Server Agent Job step, review the job step’s “Execution Plan” logging options under Job Step Properties > Advanced tab.
- Disable any “Include Execution Plan in Output” logging option if present for that step type.
Alternative or Verification Steps
- Verify the fix by re-running the
BULK INSERTstatement in a clean query window with no execution plan icons active — it should complete and return “(N rows affected)” without Error 4890. - As an alternative, use
BCP.exefrom the command line orOPENROWSET(BULK...)wrapped in anINSERT INTO ... SELECTstatement, which avoids client-side showplan toggles entirely.