SQL Server Proxy Account Principals
In database setups, sql server proxy account principals let users run tasks under shared credentials. These principals link logins, users, and roles to control what tasks an account can run. Teams use this model so people and automated tools do not need admin keys. A database user is the identity of a login when it connects to a database. Admins map logins to users and assign roles to limit what each session can do. How sql server proxy account principals work in practice SQL Server separate
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.
In database setups, sql server proxy account principals let users run tasks under shared credentials. These principals link logins, users, and roles to control what tasks an account can run.
Teams use this model so people and automated tools do not need admin keys. A database user is the identity of a login when it connects to a database. Admins map logins to users and assign roles to limit what each session can do.
How sql server proxy account principals work in practice
SQL Server separates server logins from database users to keep access boundaries clear. For people who need access to many databases on an instance, a login is common. This SQL user ties back to a login stored in the master database.
For access to one or a few databases, a contained database user is an option. A contained database user is a SQL user with a password. It is not tied to a login in the master database. An admin must first enable contained databases on the server and on the database. In total, there are 13 types of database users available to admins.
Once a user exists, teams grant permissions through roles. All roles, including the public role, have basic connect rights. Fixed database roles give quick ways to group table permissions for engineers and AI agents. Still, the permissions assigned to fixed database roles cannot be changed.
For read access, members of the data reader role can read all user tables. They can also read all views in that database. For write access, the data writer role can add, delete, or change table data. Admins can also block access with deny roles. A deny data reader role cannot read any data from user tables and views. It also cannot read metadata about those tables and views. A deny data writer role cannot add, modify, or delete any table data. At the top level, the database owner role can perform all maintenance activities. That owner role can even drop the database in SQL Server.
Database Proxy (ProxySQL, PgBouncer) + Cross-Account Access Delegation: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Security and operational tradeoffs of static roles
Static principals and fixed database roles solve basic permission mapping, but they leave gaps. When an engineer or AI agent uses a data reader role, they read every table. Because fixed role permissions cannot change, you cannot hide specific columns with that role alone.
A user in a read role gets full rows back from every query. Those results often hold sensitive fields like emails, phone numbers, card numbers, or national IDs. Static credentials also stay valid until an admin rotates the password or drops the user. If two people share a principal to run jobs, audit logs only show the shared account. You lose clear tracking of which person ran a specific query during a live session.
Managing separate users across dozens of databases also creates steady manual work for admins. Teams must add users to roles in each database and track password changes over time. Adding a live control layer in front of the database closes these gaps. Data masking rewrites matched fields like emails and card numbers in query results. Approval rules can also check single queries before they run against production tables.
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 difference between a SQL login and a contained database user?
A standard SQL user links to a server login stored in the master database. A contained database user has its own password inside one database and needs no master login. Admins must enable contained databases on the server and database before using them.
Can you change the permissions of fixed database roles in SQL Server?
No, the permissions assigned to fixed database roles cannot be changed in SQL Server. For example, the data reader role always grants read access to all user tables and views. To restrict specific tables, you must use custom roles or deny roles instead.
How do teams protect sensitive fields when using broad read roles?
Fixed read roles return all columns from user tables and views by default. Teams add dynamic data masking in the access path to protect sensitive columns during queries. Masking rewrites matched fields like phone numbers, emails, card numbers, and national IDs in results.
Related guides
In this post