SQL Server Performance

Update is not allowed

Discussion in 'SQL Server 2008 General Developer Questions' started by darkangelBDF, Sep 22, 2009.

  1. darkangelBDF Member

    Hi there all. I have a problem with an update statement. The error we're getting starts with "UPDATE is not allowed because the statement updates view..." I know the problem is that you can't have a join in the actual update statement that fires an INSTEAD OF UPDATE trigger. The update statement looks like:UPDATE
    I
    SET StyleId = @StyleId
    FROM dbo.Item I
    JOIN dbo.ItemLinkR IL
    ON IL.DivisionId = I.DivisionId
    AND IL.DeptGroupId = I.DeptGroupId
    AND IL.DeptSubGroupId = I.DeptSubGroupId
    AND IL.DepartmentId = I.DepartmentId
    AND IL.ItemId = I.ItemId
    WHERE IL.ItemLinkRPriority1Id = @ItemLinkRPriority1Id
    What would the appropriate statement look like to effectively run an update? We do not want to delete the trigger or alter it.
  2. Adriaan New Member

    Not sure that I understand the situation - is Item or ItemLinkR a view? If so, then why not fire the update against the underlying table(s).

Share This Page