Microsoft SQL Server Privileges or Permissions Simple rules

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Granting permission to create tables

USE AdventureWorks;  
GRANT CREATE TABLE TO MelanieK;  
GO 

Granting SHOWPLAN permission to an application role

USE AdventureWorks2012;  
GRANT SHOWPLAN TO AuditMonitor;  
GO  

Granting CREATE VIEW with GRANT OPTION

USE AdventureWorks2012;  
GRANT CREATE VIEW TO CarmineEs WITH GRANT OPTION;  
GO 

Granting all rights to a user on a specific database

use YourDatabase
go
exec sp_addrolemember 'db_owner', 'UserName'
go


Got any Microsoft SQL Server Question?