delete from authors(or titleauthor) where au_id='###'
表间有依赖关系,用delect和insert单独对某一表进行处理 无法完成操作
delete from titleauthor where au_id='###' delete from authors where au_id='###' 先删titleauthor表中数据,再删authors表中数据. 或者你在SQL数据库中编一个触发器 CREATE TRIGGER [aaa] ON titleauthor FOR DELETE AS declare @i as int set @i=(select au_id from deleted) delete oswxh where au_id=@iinsert添加的话还牵涉到别的表,要从关联最少的开始添加
源码看,SQL帮助了
delete from authors where au_id='###'
先删titleauthor表中数据,再删authors表中数据.
或者你在SQL数据库中编一个触发器
CREATE TRIGGER [aaa] ON titleauthor
FOR DELETE
AS
declare @i as int
set @i=(select au_id from deleted)
delete oswxh where au_id=@iinsert添加的话还牵涉到别的表,要从关联最少的开始添加