Home » Microsoft » 70-461 v.2 » How should you complete the relevant Transact-SQL statement?
HOTSPOT
You are designing an order entry system that uses an SQL Server database. The database includes the following tables:
You need to ensure that Orders are added to the Orders table only for customers that have an account balance of zero.
How should you complete the relevant Transact-SQL statement? To answer, select the correct Transact-SQL statement from each list in the answer area
Hot Area:
Correct Answer:
Explanation/Reference:
The Transact SQL CREATE TRIGGER command creates a DML, DDL, or logon trigger. A trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server. DML triggers execute when a user tries to modify data through a data manipulation language (DML) event. DML events are INSERT, UPDATE, or DELETE statements on a table or view. These triggers fire when any valid event is fired, regardless of whether or not any table rows are affected.
Partial syntax is:
CREATE TRIGGER [ schema_name . ]trigger_name
ON { table | view }
[ WITH <dml_trigger_option> [ ,…n ] ]
{ FOR | AFTER | INSTEAD OF }
{ [ INSERT ] [ , ] [ UPDATE ] [ , ] [ DELETE ] }
Reference: CREATE TRIGGER (Transact-SQL) https://msdn.microsoft.com/en-us/library/ms189799.aspx