create triger trigername on tablename for delete as
if @@rowcount>1
begin
ROLLBACK TRAN
raiserror('you can only delete one at a time.',16,10)
end
declare @sstoredID char(10)
select @sstoredID =str_id
from deleted /*DELETED 是伪表由SQL SERVER生成来包存删除的记录值.
delete from detailtable where str_id=@sstoredid