How to Fix SQL Server Error 9790 (Msg 9790)

Published
Length
3 min read

Luis Felipe Dias

All posts

You see sql server error 9790 when the msdb system database is in single user mode. To fix it, return the msdb database to multi user mode so messages can route. This issue carries message code 9790 and has a severity level of 10 in SQL Server. The engine reports that it cannot route the incoming message to the target service. The system database msdb holds the routing details needed to move messages across the instance. When an admin puts msdb into single user mode, the broker cannot read thos

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You see sql server error 9790 when the msdb system database is in single user mode. To fix it, return the msdb database to multi user mode so messages can route.

This issue carries message code 9790 and has a severity level of 10 in SQL Server. The engine reports that it cannot route the incoming message to the target service. The system database msdb holds the routing details needed to move messages across the instance. When an admin puts msdb into single user mode, the broker cannot read those routes. As a result, message delivery stops until you restore normal access to the system database.

What causes sql server error 9790 in the database engine

The database engine relies on the msdb system database to store message routing information. When an incoming message arrives, the engine checks msdb to find the right path. If msdb is in single user mode, only one session can connect at a time. Another admin session or background task often grabs that single open slot first. Then the message router tries to read msdb and fails to connect.

This state often happens during maintenance, restores, or manual repairs on the msdb database. An operator might set msdb to single user mode to run checks or apply updates. If the operator forgets to switch it back, message routing breaks across the server. Sometimes an automated script fails mid-run and leaves the database locked in single user mode. Because severity 10 is an informational status, the engine logs the failure without crashing.

How to diagnose and fix the routing failure in production

Start by checking the current access state of the msdb system database. Look for active sessions that hold the single connection to msdb right now. You may need to stop background agent jobs that try to grab that single slot. Once you find the blocking session, close it cleanly so you can run your fix. Then change the msdb database state back to multi user mode.

After you restore multi user mode, test your message queues to confirm routing works. Check the error log to verify that message code 9790 no longer appears. You do not need to grant extra roles to normal users during this repair. Keep regular engineers on read-only roles like db_datareader when they check user tables and views. Never hand out the db_owner role just to let someone inspect a status.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to prevent single user mode lockouts

Most single user mode lockouts come from manual database changes made under time pressure. You can avoid this by limiting who has permission to alter system database states. In SQL Server, a database user is the identity of a login in a database. For people who need access to many databases, a login in master is common. For access to one or a few databases, a contained database user is an option.

Assign the lowest role needed for daily work on every database. Members of db_datareader can read all data from all user tables and views. Members of db_datawriter can add, delete, or change data in all user tables. Reserve the db_owner role for strict maintenance tasks because it can drop the database. Review all maintenance scripts to make sure they always restore multi user mode on exit.

Govern SQL Server queries and responses in flight

Table grants decide which SQL Server objects a caller may touch. They do not check query intent or rewrite sensitive values in results across every client and agent. By design, hoop.dev sits inline in the TDS wire protocol next to SQL Server as a sidecar for your SQL Server. On every production batch from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for approval.

With hoop.dev guardrails and hoop.dev data masking, banned statements are refused or held for review, matched sensitive fields in supported result columns are masked in memory, and each decision is logged. Check out the code on GitHub.

Frequently asked questions

What does message code 9790 severity 10 mean in SQL Server?

It means SQL Server cannot route an incoming message because msdb is in single user mode. Severity 10 is an informational message that shows a routing failure without crashing the server.

Why does the msdb database affect message routing?

The msdb system database stores the routing table that tells SQL Server where messages go. When msdb is locked in single user mode, the routing process cannot read that table.

Do users need the db_owner role to check data after fixing error 9790?

No, you should assign the db_datareader fixed role to users who only verify table data. The db_owner role grants full control and can drop the database, so keep it restricted.

The query runs. The emails stay hidden.