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

Troubleshooting Guide: SQL Server Error 918 — Engine Script Metadata Load Failure

Why This Error Happens

Error 918 occurs when SQL Server 2025 attempts to load internal engine script DLLs (used for engine metadata, system views, or extensibility modules) but the operating system blocks or fails the load operation. This is typically caused by corrupted or missing DLL files in the SQL Server Binn directory, insufficient NTFS permissions for the SQL Server service account, or interference from antivirus/endpoint protection software quarantining the file. It can also result from an incomplete or interrupted SQL Server installation/update on Windows Server 2025 or Windows 11.

Step-by-Step Resolution Guide

Step 1: Verify the Integrity of the Script DLL

  • Locate the DLL referenced in the error message (the %.*ls placeholder in the Event Viewer log will show the exact filename, e.g., sqlscriptm.dll).
  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn\ and confirm the file exists and is not 0 KB.
  • Compare the file hash or version against a known-good installation media using PowerShell: Get-FileHash "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn\sqlscriptm.dll".

Step 2: Check and Correct File Permissions

  • Right-click the Binn folder, go to Properties > Security, and confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Read & Execute permissions.
  • Run icacls "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn" from an elevated Command Prompt to audit current permissions.
  • Re-apply inherited permissions if they were manually altered: icacls "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn" /reset /T.

Step 3: Exclude SQL Server Directories from Antivirus Scanning

  • Open Windows Security (or your third-party AV console) and add an exclusion for the entire MSSQL\Binn folder path.
  • Check the antivirus quarantine log for any recently moved .dll files matching the SQL Server engine scripts.
  • Restore any falsely quarantined files and re-scan to confirm no further detections.

Step 4: Repair the SQL Server 2025 Installation

  • Open Control Panel > Programs and Features, select Microsoft SQL Server 2025, and choose Change.
  • In the SQL Server Installation Center, select Repair and follow the wizard to restore missing or corrupted engine components.
  • Reboot Windows Server 2025 / Windows 11 after the repair completes to clear any locked file handles.

Step 5: Restart the SQL Server Service and Monitor Logs

  • Restart the SQL Server service via services.msc or run net stop MSSQLSERVER && net start MSSQLSERVER in an elevated prompt.
  • Open the SQL Server Error Log (ERRORLOG file in the Log subfolder) and confirm Error 918 no longer appears during startup.

Alternative or Verification Steps

  • Run sqlservr -c -m from the command line to start SQL Server in single-user/console mode and watch for real-time load errors referencing the script DLL.
  • If the issue persists after repair, uninstall and perform a clean reinstall of the Database Engine component, ensuring the installation media is freshly downloaded and not corrupted.