0% found this document useful (0 votes)
73 views1 page

05 Practice Exercise 1 ARG

The document outlines a practice exercise for creating and managing user roles and permissions in T-SQL. It includes steps to create a login, user, user-defined role, and assign or revoke permissions on the 'items' table. The exercise emphasizes granting and modifying access privileges for the created user.

Uploaded by

basahara sengoku
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views1 page

05 Practice Exercise 1 ARG

The document outlines a practice exercise for creating and managing user roles and permissions in T-SQL. It includes steps to create a login, user, user-defined role, and assign or revoke permissions on the 'items' table. The exercise emphasizes granting and modifying access privileges for the created user.

Uploaded by

basahara sengoku
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Delfin, Mary Cindy

BSIT A503

05 Practice Exercise 1 - ARG

Using T-SQL commands:

1. Create a login with the following credentials. Username: YourName (Ex.Mark), password:
pw123.
 CREATE LOGIN Marycindy WITH PASSWORD = ‘pw123’
2. Create another user under the login you have created.
 CREATE USER Mary FOR LOGIN Marycindy
3. Create a user-defined role named “udr_YourNickname” with a privilege of viewing and updating
the data in the “items” table.
 CREATE ROLE [udr_Mary] GRANT select, update ON ITEMS TO [udr_Mar]
4. Assign the created user-defined role to the user.
 ALTER ROLE [udr_Mary] AND ADD MEMBER Mar
5. Give the user an access to view, update, and delete data in the “items” table.
 GRANT select, update, delete ON Items TO Mar
6. Remove the role you have assigned to that user.
 ALTER ROLE udr_Mary DROP MEMBER Mar
7. Change the access of that user by removing his privilege to delete data in the “Items” table.
 REVOKE DELETE ON [Item] TO Mar

You might also like