How to Fix SQL Server Error 17142 (Msg 17142)
You get sql server error 17142 when the database service is in a paused state. To fix it, an admin must resume the service in the Windows management tool. While the engine is paused, it blocks all new client logins. Active sessions can still finish their work, but new apps cannot log in. What causes sql server error 17142 in the database engine The database engine logs this event as message 17142 with severity level 16. The official message states that the SQL Server service has been paused.
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 get sql server error 17142 when the database service is in a paused state. To fix it, an admin must resume the service in the Windows management tool.
While the engine is paused, it blocks all new client logins. Active sessions can still finish their work, but new apps cannot log in.
What causes sql server error 17142 in the database engine
The database engine logs this event as message 17142 with severity level 16. The official message states that the SQL Server service has been paused. It also notes that no new connections will be allowed on the server. To resume the service, you must use the SQL Computer Manager tool.
This state happens when an admin pauses the database service on purpose. Teams often pause the engine before they run host maintenance or apply patches. Pausing lets current queries finish without letting new apps start fresh work. Automated scripts or cluster tools can also trigger a pause during a failover check.
Because the block happens at the service level, valid logins still fail. It does not matter if you use a login in master or a contained user. Even when all database roles have connect rights, the paused engine rejects new sessions. Network routes and firewall rules may work fine, yet the login still drops.
How to diagnose and fix the paused service in production
First, check the server error log to confirm message 17142 is present. Look at the timestamp to see when the pause command ran. Ask your ops team if someone planned maintenance on that database host. Do not restart the whole server right away, or you might break active work.
Once you know the host is ready for traffic, open your service manager. Select the paused database engine instance and choose the resume action. The service will switch back to a running state within a few seconds. Test the fix by opening a new session from a standard client app.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Never grant extra server rights to app users to bypass connection blocks. Some teams give out the owner role when they debug login failures. That role lets a user change settings and even drop the database. Instead, keep users in standard read or write roles while you fix the service.
How to prevent accidental service pauses and reduce risk
Limit who can log in to the Windows host and manage services. Only senior ops staff should have the rights to pause or stop the engine. Separate host admin accounts from daily database users used by your devs.
When devs only need to read data, put them in the data reader role. This fixed role lets them read all user tables and views safely. If they need to edit rows, add them to the data writer role. You cannot change the permissions assigned to these fixed roles, which keeps rules clear.
Good access controls also protect sensitive data after you resume the database service. Masking rules can rewrite emails, phone numbers, card numbers, and national IDs in results. Set up alerts on message 17142 so your team spots paused services fast.
Add runtime guardrails beside SQL Server
Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev sits inline in the TDS protocol beside the database as a sidecar for your SQL Server. For every query an agent or human runs in production, hoop.dev decides whether to pass, mask, block, or escalate it for review.
With hoop.dev SQL Server controls, rules refuse banned statements before they run, hold risky queries for human review, and mask matched sensitive values in supported result columns in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.
Frequently asked questions
Does sql server error 17142 drop active database sessions?
No, pausing the database service does not drop active user sessions. Current users can finish their work, but the engine blocks all new logins.
Can a database owner bypass message 17142 when logging in?
No, the engine blocks every new login while the service is paused. Even a database owner or system admin must wait until the service resumes.
Why does SQL Server have a pause state instead of just stop?
The pause state lets admins drain traffic cleanly before they stop the host. Current transactions can finish without error while new apps are kept out.
Related guides
In this post