转帖:解决方法如下
CREATE TRIGGER poorder0408
ON poorder
FOR insert,update,delete
AS
SET NOCOUNT ON
IF EXISTS (select 1
from poorderentry t1
inner join porequestentry t2 on t1.fsourceinterid=t2.finterid and t1.fitemid=t2.fitemid
where t1.fqty>t2.fqty)
BEGIN
ROLLBACK TRAN
RAISERROR('订单数量不能大于申请单数量!',18,18)
END