我試圖創建一個非常簡單的觸發器,並且得到錯誤: Msg 8197,Level 16,State 4,Procedure trig_UpdateTransferBools,Line 1 對象'dbo.DW_WEEK_RANGE'不存在或無效爲此操作。創建觸發器
該表格明顯存在;我創造了它! 這可能是一個權限問題呢?
CREATE TRIGGER dbo.trig_UpdateTransferBools ON [dbo.DW_WEEK_RANGE]
AFTER INSERT, UPDATE
AS
BEGIN
IF (SELECT Transfer FROM dbo.DW_WEEK_RANGE WHERE Module = 'PURCHASES') = 1
BEGIN
UPDATE [dbo.DW_WEEK_RANGE] SET Transfer = 0 WHERE Module = 'SALES'
UPDATE [dbo.DW_WEEK_RANGE] SET Transfer = 0 WHERE Module = 'RETAIL SALES'
END
END
你確定它是在dbo上下文中創建的嗎?我們可以看到你的數據庫的截圖嗎? – 2011-04-07 13:52:01