What should you implement on the view?

ABC.com has a SQL Server 2012 database infrastructure that has a database named ComDB.
You have created a view using the following Transact-SQL code:
CREATE VIEW ABCCommunications
(Type, CompanyID, CompanyName, Location, ContactName, Email, Phone)
AS
SELECT ‘Clients’ AS Type, CompanyID, CompanyName, Location, ContactName, Email, Phone
FROM CommList
WHERE Relation = ‘Client’
SELECT ‘Partners’ AS Type, CompanyID, CompanyName, Location, ContactName, Email, Phone
FROM CommList
WHERE Relation = ‘Partner’
SELECT ‘Guests’ AS Type, CompanyID, CompanyName, Location, ContactName, Email, Phone
FROM CommList
WHERE Relation = ‘Guests’
GO
You want the view to be used to edit all columns except the CompanyID, CompanyName and
Location columns.
What should you implement on the view?

ABC.com has a SQL Server 2012 database infrastructure that has a database named ComDB.
You have created a view using the following Transact-SQL code:
CREATE VIEW ABCCommunications
(Type, CompanyID, CompanyName, Location, ContactName, Email, Phone)
AS
SELECT ‘Clients’ AS Type, CompanyID, CompanyName, Location, ContactName, Email, Phone
FROM CommList
WHERE Relation = ‘Client’
SELECT ‘Partners’ AS Type, CompanyID, CompanyName, Location, ContactName, Email, Phone
FROM CommList
WHERE Relation = ‘Partner’
SELECT ‘Guests’ AS Type, CompanyID, CompanyName, Location, ContactName, Email, Phone
FROM CommList
WHERE Relation = ‘Guests’
GO
You want the view to be used to edit all columns except the CompanyID, CompanyName and
Location columns.
What should you implement on the view?

A.
You should consider implementing an AFTER UPDATE trigger.

B.
You should consider implementing an Index.

C.
You should consider implementing an INSTEAD OF UPDATE trigger.

D.
You should consider implementing a CHECK constraint.

Explanation:



Leave a Reply 6

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


John

John

isn’t this code missing something? like I don’t know a god damn UNION ALL statement. Sigh. I hope the real exam has better code.

lewis

lewis

c

shv

shv

but why ā€œcā€ only is the answer

shv

shv

but why “c” only is the answer

Derek

Derek

The question is whacked, but the intent is obvious. The answer is C.
The view has multiple underlying tables, this necessitates any updates occur with an INSTEAD OF trigger.
A is wrong, their can be no after trigger if the view can’t update.
B is a distraction.
C is correct.
D is a distraction.