Essential SQL Server Roles Flashcards

Explore key concepts of SQL Server roles and permissions with these engaging flashcards.

1
Q

What is a database role?

A

A database role specifies a group of database users that can access the same objects of the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Who can be members of a database role?

A

Members can be Windows groups, user accounts, SQL Server logins, or other roles.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two types of predefined roles in SQL Server?

A

The two types are fixed server roles and fixed database roles.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are fixed server roles?

A

Fixed server roles are defined at the server level and exist outside of databases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which system procedures are used to manage fixed server roles?

A

The procedures are sp_addsrvrolemember and sp_dropsrvrolemember.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Can you add or remove fixed server roles?

A

No, you cannot add or remove fixed server roles.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you view permissions for fixed server roles?

A

You can view permissions using the sp_srvrolepermission system procedure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are fixed database roles?

A

Fixed database roles are defined at the database level and exist in each database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are application roles?

A

Application roles enforce security for a particular application, allowing it to handle user authentication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Do application roles have members?

A

No, application roles do not have members.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is required to activate an application role?

A

A password is required to activate an application role.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the syntax to create an application role?

A

USE sample
GO
CREATE APPLICATION ROLE weekly_reports WITH PASSWORD =’x1y2z3w4’, DEFAULT_SCHEMA =my_schema

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you activate an application role after a connection is started?

A

You must execute the sp_setapprole system procedure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the syntax for sp_setapprole?

A

sp_setapprole [@rolename =] ‘role’, [@password =] ‘password’, [,@encrypt =] ‘encrypt_style’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are user-defined database roles?

A

User-defined roles are applied when a group of users needs to perform common activities and no applicable Windows group exists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the syntax to create a user-defined role?

A

CREATE ROLE role_name [AUTHORIZATION owner_name]

17
Q

Which system procedures are used to manage user-defined roles?

A

The procedures are sp_addrolemember, sp_droprolemember, and sp_helprole.