75.9k views
22 votes
Write a script that creates a user-defined database role named paymententry in the ap database. give update permission to the new role for the vendors and invoices table, update and insert permission for the invoicelineitems table, and select permission for all user tables.

User Bchurchill
by
3.4k points

1 Answer

8 votes

Answer:

USE AP CREATE ROLE PaymentEntry

GRANT UPDATE, DELETE ON Invoices TO PaymentEntry

GRANT UPDATE, INSERT ON InvoiceLineItems TO PaymentEntry

EXEC sp_AddRoleMember db_datareader, PaymentEntry

Write a script that creates a user-defined database role named paymententry in the-example-1
User Nick Zinger
by
3.9k points