Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

SQL Server Error 959: Fix Resource Database Version

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

SQL Server Error 959 occurs when the internal resource database (the hidden system database containing system objects) is out of sync with the SQL Server engine version. This typically happens after a failed update, a partial patch installation, or when a SQL Server instance is upgraded but the resource database fails to update to the matching version. To fix this, you must run the SQL Server setup process to repair the installation or manually apply the missing Cumulative Update (CU) or Service Pack (SP) to align the versions.

What You'll Need

  • Administrator privileges on the Windows Server hosting the SQL Server instance.
  • The original installation media for the specific version of SQL Server you are running.
  • The latest Cumulative Update (CU) or Service Pack (SP) installer corresponding to your SQL Server version.
  • Access to the SQL Server Configuration Manager.
  • A full backup of all user databases (as a safety precaution before performing system repairs).

Step-by-Step

  1. Identify the Exact Version Mismatch: Open SQL Server Management Studio (SSMS) if possible. Run the command SELECT @@VERSION;. Note the build number. If SSMS cannot connect due to Error 959, check the SQL Server Error Log located in the LOG folder of your installation directory. The log will explicitly state the expected version of the resource database versus the version currently found on disk.
  2. Stop SQL Server Services: Open the SQL Server Configuration Manager. Locate the SQL Server (MSSQLSERVER) or named instance service. Right-click the service and select Stop. Ensure that the SQL Server Agent service is also stopped, as it depends on the main engine.
  3. Run the Setup Repair Tool: Navigate to the installation media or the folder where the SQL Server setup files are stored. Run setup.exe. In the SQL Server Installation Center window, select Maintenance from the left-hand sidebar. Click on Repair. The wizard will scan the instance and attempt to synchronize the system databases, including the resource database, with the current binary version of the engine.
  4. Apply the Missing Update: If the repair tool does not resolve the version mismatch, it is likely that a Cumulative Update was partially applied. Download the specific CU or Service Pack that matches the target version mentioned in the error log. Run the update installer. This process forces the engine to overwrite the resource database files with the correct versioned files.
  5. Verify File Permissions: Navigate to the Binn folder of your SQL Server installation (usually under C:\Program Files\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\MSSQL\Binn). Ensure that the service account running SQL Server has full read and execute permissions on the resource database files. If the installer failed to update the files due to permission locks, the error will persist.
  6. Restart the Instance: Return to the SQL Server Configuration Manager. Right-click the SQL Server service and select Start. Monitor the Error Log in real-time to ensure that the resource database is successfully initialized and that Error 959 no longer appears.
  7. Final Validation: Log into the instance using SSMS and run SELECT @@VERSION; again. Confirm that the build number matches the expected version of the update you applied. Attempt to create a new database or perform a system object query to ensure the resource database is fully functional.

Common Mistakes

One of the most frequent mistakes is attempting to manually copy mssqlsystemresource.mdf files from another server. The resource database is a read-only system database that is tightly coupled with the specific build and patch level of the SQL Server binaries. Copying files from a different build—even if it is the same major version—will often lead to further corruption or a different set of version mismatch errors. Another common error is running the repair tool without administrator privileges; the setup process requires deep access to the registry and system folders to replace the resource database files.

Some administrators attempt to fix the issue by deleting the resource database files manually. This is highly dangerous. The resource database is not a standard user database; it is the template from which master and model databases are derived. Deleting these files without having the installer ready to replace them can render the SQL Server instance completely unbootable, requiring a full uninstall and reinstall of the software.

Tips

To prevent this error in the future, always ensure that SQL Server updates are performed during a dedicated maintenance window where no other heavy processes are running. This reduces the chance of a file being locked during the update process, which is a primary cause of the resource database failing to update. Additionally, always check the SQL Server Error Log immediately after any patch application. If you see warnings about the resource database version, address them immediately before the instance is put back into production.

When downloading updates, use the official Microsoft Update Catalog. Ensure you are downloading the update for the correct edition (e.g., Standard, Enterprise, or Express) and the correct version (e.g., 2017, 2019, 2022). Applying a patch intended for a different version of the engine will not fix Error 959 and may introduce new stability issues.

Troubleshooting

If the repair process fails or the error persists after applying a Cumulative Update, check for third-party antivirus or endpoint security software. These programs often lock the .mdf and .ldf files in the system folders, preventing the SQL Server installer from replacing the outdated resource database. Temporarily disable the antivirus scan on the SQL Server data and Binn directories and attempt the repair again.

If you encounter an error during the repair process stating that the installation is corrupted, you may need to perform a "Clean Uninstall." This involves uninstalling the SQL Server instance, manually deleting the remaining folders in Program Files and Program Files (x86), and cleaning the registry keys associated with that instance. Once the environment is clean, perform a fresh installation using the latest patched media. This is the most drastic measure and should only be used if the repair and CU application fail.

If the service fails to start and the log indicates a "checksum error" or "page corruption" in the resource database, the files on disk are physically damaged. In this scenario, the only solution is to use the installation media to perform a repair, as the resource database cannot be "recovered" using standard T-SQL recovery commands like DBCC CHECKDB because it is a read-only template.

Frequently Asked Questions

Can I fix Error 959 using a T-SQL command?

No. Because the resource database is a read-only system file used to initialize other databases, you cannot use ALTER DATABASE or other T-SQL commands to update its version. The fix must be applied at the binary level via the installer or a patch.

Will repairing the resource database delete my user data?

No. The resource database contains system objects and templates. It does not store your user data, tables, or application logic. However, it is always recommended to have a full backup of your user databases before running any installation repair.

Why did this happen after a successful-looking update?

Sometimes the update process successfully updates the SQL Server binaries (the .exe and .dll files) but fails to update the resource database file due to a file lock or a permission issue. This creates a mismatch where the engine is newer than the database it relies on.

Do I need to reinstall the entire SQL Server instance?

Not usually. A "Repair" operation through the SQL Server Installation Center or applying the correct Cumulative Update is typically sufficient to synchronize the versions without a full reinstall.

Is the resource database the same as the master database?

No. The master database stores system-level information for the instance. The resource database is a hidden, read-only database that provides the objects used to create the model and master databases. Error 959 specifically targets this hidden template database.