日期:2014-05-17  浏览次数:20594 次

SQL 触发器
if Exists(Select name from sysobjects where name = 'StoneWidthT')
drop table StoneWidthT
create table StoneWidthT
(
  id int primary key identity,
  stone_id int Foreign key references StoneT(id) not null, --石材ID
  width int not null, --宽度600头、800头
  [square] float not null  --数量(多少平方)
)

以上是一张表,其中,stone_id 可重复,如何在SQL触发器中遍历所有同一个stone_id的记录呢? 谢谢各位

------解决方案--------------------
你这个是想递归执行触发器是吧?据我了解好像不行,另外,就算可以,也几乎没什么可用之地,性能肯定很低,并且容易造成死锁、阻塞等问题。