How to Fix SQL Server Error 33129 (Msg 33129)
You get sql server error 33129 when you try to enable or disable a group login. To fix it, grant or revoke the connect permission for that Windows or Entra group instead. Database admins often automate user management across many database servers. When a script treats a group login like a single person, the engine blocks the action. Understanding how the engine handles group logins helps you fix the script fast. Why sql server error 33129 happens in the engine The database engine raises mess
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 33129 when you try to enable or disable a group login. To fix it, grant or revoke the connect permission for that Windows or Entra group instead.
Database admins often automate user management across many database servers. When a script treats a group login like a single person, the engine blocks the action. Understanding how the engine handles group logins helps you fix the script fast.
Why sql server error 33129 happens in the engine
The database engine raises message 33129 at severity level 16. This error happens when you run an alter login command with the enable or disable option. The engine blocks this option when the target is a Windows group or an Entra group.
Individual logins and group logins work in different ways inside the master database. A login in the master database lets a person or group enter the server instance. When that login enters a specific database, it maps to a database user identity.
For a single login, the engine lets you flip an enable or disable switch. Group logins do not support that direct switch at the server login level. Instead, the engine controls group entry through server-level connect permissions.
This rule stops admins from using the wrong syntax on directory groups. Because severity 16 marks errors caused by the user, your script stops right away. You must update your command to match how the engine manages groups.
How to diagnose and fix the failure in production
First, check the login type of the target account in your admin tool. Look at the server principals to see if the account is a group. A Windows group or Entra group will trigger sql server error 33129 if you disable it.
To block a group from logging in, revoke the connect SQL permission for that group. To let a blocked group back in, grant the connect SQL permission to that group. This achieves the exact same goal without triggering the syntax error.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You should also check if the group has too many rights inside individual databases. A database user is the identity of a login when it connects to a database. If people only need access to one database, consider a contained database user instead.
Contained users have a password and do not tie to a login in master. An admin must enable contained databases on the server and database first. For people who need access to many databases, a standard login in master is common.
Managing database roles and least privilege
When you fix login scripts, review what those groups can do inside each database. Fixed database roles have set permissions that you cannot change. All database roles, including the public role, have connect rights inside the database.
Members of the data reader role can read all data from user tables and views. Members of the data writer role can add, delete, or change data in user tables. If a group must not read data, use the deny data reader role.
The deny data reader role stops users from reading user tables, views, or metadata. The deny data writer role stops users from adding, changing, or deleting table data. Avoid giving groups the database owner role during a quick fix.
The database owner role can run all maintenance tasks and can even drop the database. Instead, add users to safe roles using the standard alter role command. If you use Azure Synapse, use the add role member stored procedure instead.
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
What is the severity level of sql server error 33129?
This error has a severity level of 16. Severity 16 means the error comes from user syntax or rules that the admin can fix.
Can I drop a Windows or Entra group login instead of revoking permissions?
Yes, you can drop the group login if the team will never need it again. If you only want a temporary pause, revoking the connect permission is safer.
How do I block a group from reading tables in just one database?
Keep their server login active and add the group to the deny data reader role. This blocks table and view reads in that single database while keeping other access intact.
Related guides
In this post