liveBook · Manning

Custom role

As explained in 100 SQL Server Mistakes and How to Avoid Them

A custom role is a user-defined SQL Server role with specifically selected permissions for a required task.

Mistake #1: granting broad fixed-role membership because it seems faster. A custom role assigns only the permissions required for a task, reducing unauthorized changes and operational surprises. section 14.1

A safer operational permission

A failover workflow can use a custom server role with permissions such as CONNECT SQL, VIEW SERVER STATE, and availability-group permissions. A database can instead use an ExecSP role granting EXECUTE without unnecessary database access. section 14.1

Treat role design as an operational safeguard: unplanned elevated access can cause performance or stability problems that the DBA team must investigate. Applying the role in model propagates it to new databases, but increases maintenance responsibility. section 14.1

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Defines custom server and database roles, shows permission assignments, and cautions against overloading model.
Examples
Uses failover permissions and stored-procedure execution as concrete custom-role scenarios.
What it assumes
Assumes familiarity with SQL Server permissions, fixed roles, and the distinction between server and database scope.
What you can do after
Build it from scratch using T-SQL grants and membership changes for narrowly defined server or database tasks.
How it connects
Connects least privilege with fixed roles, availability groups, stored procedures, and the model database.

Also explained in

Compare how 3 books explain custom role →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.