--Bai tap ve nha
create view RevOrderDetails as
select o.OrderID,CustomerID,ProductID,Quantity
from [Order Details] od, Orders o
where od.OrderID=o.OrderID
select * from RevOrderDetails
alter trigger DeleteOrder
on RevOrderDetails instead of Delete
as
begin
delete from [Order Details] where OrderID in(select OrderID from deleted)
delete from Orders where OrderID in (select OrderID from deleted)
end
delete from RevOrderDetails where OrderID=10248
Nuk ka komente:
Posto një koment