if exists(select name from sysobjects where name='insert_bill_Update_room' and TYPE='p')
drop procedure insert_bill_Update_room
go
create proc insert_bill_Update_room
@bd_Id varchar(10)
as
insert into tb_bill (b_Id,bd_Id,b_SumPrices,b_RateSumprices,b_Rate,b_Date,b_Time) values(@b_id,@bd_Id,@b_SumPrices,@b_RateSumPrices,@rate,@date,@time)
update tb_room set [email protected] where [email protected]_Id
这样写对否。。。。
------解决方案--------------------
- SQL code
这个问题应该建一个触发器:gocreate trigger tri_test on 插入数据的表for insertasupdate 需要更新的表 bset 字段=相关字段...... from inserted a where a.标识列=b.标识列