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