05 Practice Exercise 1 ARG

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 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