SQL Server替代触发器问题
现在有两张表和一个视图
一张是订单表
create table userOrders
(
userId varchar(10) references users(userId),
orderId varchar(20) primary key,
buyDate datetime,
oederState bit
)
go
另一张是订单详情表
create table ordersDetail
(
ordersId varchar(20) references userOrders(orderId),
tradeId varchar(20) references merchandise(tradeId),
number int
constraint fk_order_trade primary key(ordersId,tradeId)
)
go
视图是是如下定义的:
create view userOrdersDetail
as
select * from userOrders join ordersDetail on ordersDetail.ordersId=userOrders.orderId
go
现在要向视图userOrdersDetail插入一条数据
怎样编写替代触发器
请高手指教
[解决办法]
视图是临时表不能插数据