注意:此页面搜索的是所有试题
题目内容
(物理学(专升本))
你的数据库包含两个表,名为Order和OrderDetails,其中存储订单信息。它们使用每个表中的OrderID列相互关联。公司要求Order表中的LastModifiedDate列必须反映OrderDetails表中相关订单的更改日期和时间。你需要创建触发器来实现此业务要求。应使用哪一条Transact-SQL语句?
A.CREATE
TRIGGER [uModDate] ON [OrderDetails] INSTEAD OF UPDATE FOR REPLICATION AS
UPDATE [Order] SET [LastModifiedDate] = GETDATE() FROM inserted WHERE
inserted.[OrderID] = [Order].[OrderID];
B.CREATE TRIGGER [uModDate] ON [Order] INSTEAD OF UPDATE
NOT FOR REPLICATION AS UPDATE [Order] SET [LastModifiedDate] = GETDATE() FROM
inserted WHERE inserted.[OrderID] = [Order].[OrderID];
C.CREATE
TRIGGER [uModDate] ON [Order] AFTER UPDATE FOR REPLICATION AS UPDATE [Order]
SET [LastModifiedDate] = GETDATE() FROM inserted WHERE inserted.[OrderID] =
[Order].[OrderID];
D.CREATE
TRIGGER [uModDate] ON [OrderDetails] AFTER UPDATE NOT FOR REPLICATION AS UPDATE
[Order] SET [LastModifiedDate] = GETDATE() FROM inserted WHERE inserted.[OrderID]
= [Order].[OrderID];
A.CREATE
TRIGGER [uModDate] ON [OrderDetails] INSTEAD OF UPDATE FOR REPLICATION AS
UPDATE [Order] SET [LastModifiedDate] = GETDATE() FROM inserted WHERE
inserted.[OrderID] = [Order].[OrderID];
B.CREATE TRIGGER [uModDate] ON [Order] INSTEAD OF UPDATE
NOT FOR REPLICATION AS UPDATE [Order] SET [LastModifiedDate] = GETDATE() FROM
inserted WHERE inserted.[OrderID] = [Order].[OrderID];
C.CREATE
TRIGGER [uModDate] ON [Order] AFTER UPDATE FOR REPLICATION AS UPDATE [Order]
SET [LastModifiedDate] = GETDATE() FROM inserted WHERE inserted.[OrderID] =
[Order].[OrderID];
D.CREATE
TRIGGER [uModDate] ON [OrderDetails] AFTER UPDATE NOT FOR REPLICATION AS UPDATE
[Order] SET [LastModifiedDate] = GETDATE() FROM inserted WHERE inserted.[OrderID]
= [Order].[OrderID];
参考答案