SQL Server error 925 means the instance has hit its configured limit on how many databases a single login can own or use at once. The fix is to drop or detach databases you no longer need, move some to another instance, or raise the limit at the server level with sp_configure. You need sysadmin rights and a current backup before you change anything.

What You'll Need

  • Sysadmin (or equivalent) access to the affected SQL Server instance.
  • A recent backup of any database you plan to drop, detach, or move.
  • SQL Server Management Studio (SSMS) or another client that can run T-SQL.
  • Permission to change server-level configuration (sp_configure with the 'show advanced options' setting enabled).
  • A list of which logins own which databases, so you know where the pressure is coming from.

Step-by-Step

  1. Confirm the error and the limit. Connect to the instance and run SELECT * FROM sys.configurations WHERE name = 'user instances enabled'; and also check SELECT value_in_use FROM sys.configurations WHERE name = 'max worker threads'; — but the setting that matters for error 925 is the per-login database limit controlled by the user options and the instance's database count. The practical check is to count databases: SELECT COUNT(*) FROM sys.databases;. If the count is at or near the limit your edition allows, that is your cause. Labels and exact wording in SSMS can differ slightly by version, device, or region.
  2. Back up before you touch anything. For every database you may remove, run a full backup and verify it. A detach without a backup is a one-way door if the files are later lost.
  3. Find out which databases are actually in use. Run SELECT name, state_desc, user_access_desc FROM sys.databases ORDER BY name;. Look for databases in RESTORING, RECOVERY_PENDING, or OFFLINE states — these still count toward limits but serve no purpose.
  4. Drop or detach the dead weight. For a database you no longer need, use DROP DATABASE [dbname];. If you want to keep the files for later, use sp_detach_db 'dbname'; instead. Both free the slot. Never drop a database that is still being written to by an application.
  5. Move large or archival databases to another instance. Back up, restore on a second SQL Server instance, then drop the original. This is the cleanest long-term fix when you genuinely need the data.
  6. Raise the limit if your edition supports it. In SSMS, right-click the server, choose Properties, and look at the Database Settings page for the maximum number of databases or user instances. Alternatively, run sp_configure 'show advanced options', 1; RECONFIGURE; then sp_configure 'user instances enabled', 1; RECONFIGURE; where that option applies. Note that Express editions have hard caps that cannot be raised — if you are on Express, moving databases off the instance is the only real answer.
  7. Recycle the service if the change does not take effect. Some server-level settings only apply after a restart of the SQL Server service. Warn users first; a restart drops all connections.
  8. Verify the fix. Reconnect with the login that hit the error and try the operation again. Then run the count query from step 1 to confirm you are below the limit with headroom.

Common Mistakes

  • Dropping a database without a verified backup. Always restore-test the backup before deleting the original.
  • Detaching a database that an application still has open — the detach fails or the app breaks. Check active connections with sp_who2 first.
  • Assuming every edition can raise the limit. Express editions have fixed caps; the setting simply will not help there.
  • Forgetting that offline and restoring databases still occupy a slot. Clean those up first.
  • Changing server configuration without recording the old values, making rollback guesswork.
  • Running the fix during peak hours without warning users about the possible service restart.

Tips

  • Keep a simple inventory of databases and owners so you notice growth before you hit the ceiling.
  • Use a naming convention that flags archival databases, making them easy to move off the production instance.
  • Schedule a quarterly review of unused databases; a database with no connections in 90 days is a candidate for detach.
  • Record the before-and-after values of any sp_configure change in your change log.
  • If you are near the limit on Express, plan a move to a higher edition rather than repeatedly cleaning up.

Troubleshooting

If the error persists after cleanup, re-run the count query — another login or process may have created a new database in the meantime. If DROP DATABASE fails because the database is in use, set it to single-user mode with ALTER DATABASE [dbname] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; and retry; this forcibly disconnects users, so do it in a maintenance window. If sp_configure reports the option is not available, your edition does not support it — move databases off the instance instead. If a restart is required and you cannot take one, schedule it for the next maintenance window and document the interim workaround. If you are unsure whether a database is safe to remove, restore it to a test instance first and confirm the application does not depend on it.

Frequently Asked Questions

What exactly does error 925 mean?

It means the instance has reached the maximum number of databases allowed for the login or for the edition, so the requested operation cannot create or attach another database.

Can I just increase the limit?

On editions that support it, yes, through server properties or sp_configure. Express editions have fixed caps that cannot be raised, so you must remove or move databases.

Does an offline database count toward the limit?

Yes. Offline, restoring, and recovery-pending databases still occupy a slot, which is why cleaning those up first often resolves the error.

Will dropping a database delete its files?

Yes. Dropping removes the database and its files. If you want to keep the files, detach instead, and always take a backup first.

Do I need to restart SQL Server after changing the limit?

Some server-level settings only take effect after a service restart. Check the message returned by RECONFIGURE; if it says a restart is required, plan one.

What if I cannot drop any databases?

Move the least-used databases to another instance by backup and restore, then drop the originals. That frees slots without losing data.