满意答案
a01438
2017.08.03
采纳率:53% 等级:7
已帮助:110人
建议你写个存储过程,我写的一个,让你参考一下!CardNo是自定义的数据类型!用触发器容易出错
CREATE PROCEDURE DelFixUser
@CardNo CardNo
AS
Declare @CarNo CarNo
select @CarNo=车辆号码 from FixCardIndexTable
where 卡号=@CardNo
Delete from AllCardIndexTable
where 卡号=@CardNo
Delete from FixCardIndexTable
where 卡号=@CardNo
Delete from FixCardEndDateTable
where 卡号=@CardNo
Delete from CardPassWordTable
where 卡号=@CardNo
Delete from UserCarInfoTable
where 车辆牌号=@CarNo
说明:删除一个固定用户记录,同时从AllCardIndexTable、FixCardIndexTable、FixCardEndDateTable、CardPassWordTable和UserCarInfoTable表中删除相应的记录。
00分享举报