sql
select * from StnInfo,ClassInfo where StnInfo.cid=ClassInfo.Id


go
create proc del_class @id int
as
begin tran
declare @error int=0
delete from StnInfo where cid=@id
set @error+=@@ERROR
delete from ClassInfo where id=@id
set @error+=@@ERROR
if @error<>0
rollback tran ---回滚事务到还原点

else
commit tran ---提交事务
go

posted on 2021-11-22 17:30  无敌拖油瓶  阅读(20)  评论(0编辑  收藏  举报