高手,我的觸發程序有什麼問題?
我不資料表中加一觸發器
CREATE TRIGGER tMaterial_Update ON dbo.tMaterial
FOR update
AS
if exists(select * from deleted where locked=1)
begin
Raiserror ('您不能修改已經審核的資料',16,1)
return
end
insert into tmaterialbak (MatId, MatDesc) select MatId, MatDesc from deleted
我直接在資料表中改資料就不可以保存
但我在程序中運行以下語句
rsmain.ActiveConnection = strConn
rsmain.UpdateBatch
Set rsmain.ActiveConnection = Nothing
會有錯誤提示,但資料不是被保存了!
為什麼?天!我好頭痛!