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

Troubleshooting Guide: Error 4893 – SSIS File Mapping Object Could Not Be Opened

Why This Error Happens

This error occurs when SQL Server 2025 attempts a bulk load operation (via BULK INSERT or SSIS) using a shared memory file mapping object, but the operating system denies access to that memory-mapped file. The root cause is typically a security context mismatch—the SQL Server service account and the client application are not running under the same Windows security context, or the connection is not using integrated authentication against a local instance. It can also surface when the SQL Server service account lacks sufficient permissions on the Global\ namespace for shared memory objects, or when a previous SSIS session terminated abnormally and left an orphaned file mapping handle.

Step-by-Step Resolution Guide

Step 1: Verify Authentication Mode and Connection Locality

  • Confirm the client application is connecting to a local SQL Server instance, not a remote one, since file mapping objects for bulk load only function locally.
  • Check the connection string to ensure Integrated Security=SSPI or Trusted_Connection=Yes is explicitly set rather than SQL Authentication.
  • Open SQL Server Management Studio and verify under Server Properties > Security that Windows Authentication mode is enabled.

Step 2: Reset Service Account Permissions

  • Open Services.msc on Windows Server 2025 and locate the SQL Server (MSSQLSERVER) service.
  • Ensure the service is running under a dedicated domain or virtual service account (e.g., NT Service\MSSQLSERVER) rather than Local System, as Local System can sometimes cause namespace isolation issues with newer Windows 11/Server 2025 session separation.
  • Grant the service account explicit Create Global Objects rights via secpol.msc under Local Policies > User Rights Assignment.
  • Restart the SQL Server service for the policy change to take effect:
  net stop MSSQLSERVER && net start MSSQLSERVER

Step 3: Clear Orphaned Shared Memory Handles

  • Open Task Manager and check for lingering sqlservr.exe or dtexec.exe processes from a previous failed session.
  • Terminate any zombie processes holding the memory-mapped file lock:
  taskkill /F /IM dtexec.exe
  • Reboot the Windows Server 2025 instance if multiple orphaned handles are suspected, as this clears the Global\ kernel object namespace entirely.

Step 4: Validate SSIS Package Execution Context

  • In the SSIS package connection manager, confirm the Provider is set to Native OLE DB and not a mismatched legacy driver.
  • Ensure the package is executed by the same user account that has sysadmin or bulkadmin rights on the target SQL Server instance.
  • Re-run the package using dtexec from an elevated command prompt to rule out UAC-related session isolation:
  dtexec /f "C:\Packages\YourPackage.dtsx"

Alternative or Verification Steps

  • To verify the fix, run a simple BULK INSERT command from a query window using the same service account credentials and confirm it completes without Error 4893.
  • If the issue persists, as an alternative, switch the bulk load method from a file mapping object to a standard flat-file data source using OPENROWSET(BULK...), which bypasses the shared memory mapping mechanism entirely.