Access control of MS SQL – Part 1

MSSQL-Feature-Image

SQL Server has 2 authentication mode:

1: Windows Authentication Mode (Default mode)
2: SQL Server and Windows Authentication Mode

How to change authentication mode:
1. Login SSMS
2. Right-click SQL instance in Object Explorer > select Properties
3. Select “Security” page > select suitable “Server authentication” > “OK”
4. Right-click SQL instance in Object Explorer > select “Restart” to restart SQL Service.
If you find that Start, Stop, Pause, Resume and Restart are greyed out, Please go to SQL Server enable “Windows Management Instrumentation (DCOM-In)” and “Windows Management Instrumentation (WMI-In)

SQL Server’s authentication is managed by “Logins” at server level and by “Users” at database level.
“Logins”
allow you to manage the connection to SQL Server and assign to “Server Roles
“Users”
 allow you to mange the permission of Database and assign to “Database Role
Both of them should map with each other.

How to create a New Logins via GUI:
1. Expand “Security” > Right-click “Logins” > select “New Login…
2. Select “Windows authentication” for domain account or “SQL Server authentication” for SQL Server account.

How to create a New Logins via T-SQL:
Create Login — “Windows authentication

Create Login — “SQL Server authentication

How to create a New Users via GUI:
1. Expand “Databases” > Expand “Database’s name” > Expand “Security” > Right-Click “Users” > select “New User…
2. At “Login name:” select “Logins” need to map with this Users
3. Normal “User name:” should be same with “Login name:

How to create a New Users via T-SQL:

Author: Joe Chan

1 thought on “Access control of MS SQL – Part 1

Comments are closed.