请帮忙看一下!!!!!
CREATE TRIGGER dbo.insert_subsidiarystuff ON dbo.st_subsidiarystuff
FOR INSERT AS
BEGIN
if (select count(*)
from st_stockpile_stuff
where st_stockpile_stuff.storage_no = inserted.storage_no
and st_stockpile_stuff.contract_no = inserted.contract_no
and st_stockpile_stuff.oc_number = inserted.oc_number
and st_stockpile_stuff.itemnumber = inserted.itemnumber
and st_stockpile_stuff.bomnumber = inserted.bomnumber
and st_stockpile_stuff.breadthtype = inserted.breadthtype ) = 0
begin
insert into st_stockpile_stuff
select storage_no,contract_no,oc_number,itemnumber,bomnumber,breadthtype,stockplace,
categoryno,'001',stockof_qty,0,stock_date,'',buyer_id,storekeeper,memo_stock
from inserted
end
END
错在哪?