Level | Principals |
---|---|
Windows | Windows local user account Windows domain user account Windows group |
SQL | SQL Server login SQL Server role |
Database | Database user Database role Application role |
Permissions are the rules that govern the level of access that principals havt to securables. You can grant, revoke, or deny access over SQL Server securables to SQL Server principal.
CREATE LOGIN login_name { WITH SQL_login_optioins | FROM WINDOWS [ WITH windows_login_options ] }
Role | Description |
---|---|
sysadmin | Perform any activity |
dbcreator | Create and alter databases |
diskadmin | Manage disk files |
serveradmin | Configure server-wide settings |
securityadmin | Manage and audit server logins |
processadmin | Manage SQL Server processes |
bulkadmin | Run the BULK INSERT statement |
setupadmin | Configure replication and linked servers |
CREATE CREDENTIAL credential_name WITH IDENTITY = 'identity_name' [ , SECRET = 'secret' ]
USE master GRANT ALTER ANY DATABASE TO [ADVENTUREWORKS\Holly]
USE master GRANT ALTER ON LOGIN :: AWWebApp TO [ADVENTUREWORKS\Holly]
USE AdventureWorks GRANT ALTER ANY USER TO HRManager
USE AdventureWorks GRANT SELECt ON SCHEMA :: Sales TO Salesuser
USE AdventureWorks GRANT EXECUTE ON TYPE :: Person.addressType TO SalesUser
USE AdventureWorks GRANT SELECT ON Sales.Order TO SalesUser
Service master key - Database master key +- Asymmetric key - Symmetric key | +- Certificate