Which Transact-SQL statement should you use?

You administer a Microsoft SQL Server 2012 database named ContosoDb. The database
contains a table named Suppliers and a column named IsActive in the Purchases schema.
You create a new user named ContosoUser in ContosoDb. ContosoUser has no
permissions to the Suppliers table. You need to ensure that ContosoUser can delete rows
that are not active from Suppliers. You also need to grant ContosoUser only the minimum
required permissions. Which Transact-SQL statement should you use?

You administer a Microsoft SQL Server 2012 database named ContosoDb. The database
contains a table named Suppliers and a column named IsActive in the Purchases schema.
You create a new user named ContosoUser in ContosoDb. ContosoUser has no
permissions to the Suppliers table. You need to ensure that ContosoUser can delete rows
that are not active from Suppliers. You also need to grant ContosoUser only the minimum
required permissions. Which Transact-SQL statement should you use?

A.
GRANT DELETE ON Purchases.Suppliers TO ContosoUser

B.
CREATE PROCEDURE Purchases.PurgeInactiveSuppliers
WITH EXECUTE AS USER = ‘dbo’
AS
DELETE FROM Purchases.Suppliers WHERE IsActive = 0
GO
GRANT EXECUTE ON Purchases.PurgelnactiveSuppliers TO ContosoUser

C.
GRANT SELECT ON Purchases.Suppliers TO ContosoUser

D.
CREATE PROCEDURE Purchases.PurgeInactiveSuppliers
AS
DELETE FROM Purchases.Suppliers WHERE IsActive = 0
GO
GRANT EXECUTE ON Purchases.PurgeInactiveSuppliers TO ContosoUser

Explanation:
Reference:
http://msdn.microsoft.com/en-us/library/ms188354.aspx
Reference:
http://msdn.microsoft.com/en-us/library/ms187926.aspx



Leave a Reply 11

Your email address will not be published. Required fields are marked *


h

h

I think it’s B

LVCHE

LVCHE

No … the clause USER is not possible with AS …

Syntax of AS Clause
{ EXEC | EXECUTE } AS { CALLER | SELF | OWNER | ‘user_name’ }

Google

Google

Check below, are some completely unrelated web-sites to ours, having said that, they’re most trustworthy sources that we use.

Mobile and Landline virtual number buy

Mobile and Landline virtual number buy

Wonderful story, reckoned we could combine a number of unrelated data, nonetheless definitely really worth taking a look, whoa did one understand about Mid East has got a lot more problerms as well

how to make money from home

how to make money from home

although web sites we backlink to below are considerably not associated to ours, we feel they’re basically really worth a go by, so have a look

Mariage

Mariage

Sites of interest we have a link to

Free download pc games

Free download pc games

just beneath, are numerous completely not connected web sites to ours, nevertheless, they are surely really worth going over

create your own app

create your own app

The facts talked about within the article are a number of the most effective available

satta matka

satta matka

Here are some of the web sites we advise for our visitors

social apps

social apps

below youll discover the link to some web-sites that we think you need to visit

Miracle Pianist videos

Miracle Pianist videos

The facts mentioned within the article are a number of the ideal obtainable