Hi Friends,

Today, I want to focus on a very helpful feature SQL Server 2012 User Defined Server Roles (Denali).

In SQL Server 2005 and SQL Server 2008, there are only nine fixed server roles to grant the permissions. These nine fixed server roles are shown below in figure:

1_SQL_Server_2012_User_Defined_Server_Role

Now with SQL Server 2012 we can create user defined Server Roles using TSQL as well as SSMS.

Creating Server role using TSQL:

Here for testing purpose, I am creating a new role TestRole and granting Trace Event Notification permission.

Here, I have already created a login SQLGEEK. Now I am just adding this login as a member to newly created server role:

Creating Server role using SSMS:

1- Open the SQL Server instance in SSMS.

2- Expand the object explorer.

3- Expand the security node.

4- Now Right Click on Server Roles under security node and click on properties

2_SQL_Server_2012_User_Defined_Server_Role

5- This will open new server role window. Here on general page fill all the details like role name, check on servers option under securable and assign permissions under explicit.

3_SQL_Server_2012_User_Defined_Server_Role

6- Now go to Members page on this window and add the login under this Server Role. Here, I have already created a new login SQLGEEK. So, I am just adding this login:

4_SQL_Server_2012_User_Defined_Server_Role

7- If you want to assign any existing server Role Membership for this user defined  server role, then go to Memberships page and select the existing server role.

5_SQL_Server_2012_User_Defined_Server_Role

8- Click OK.

 

Regards

Prince Rastogi

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook