creating a trigger on a view

  • Hi All

    for some reason i cant create a trigger on a view

    i get an error the the view name is in correct

    any 1 knows whats the problem????

    are there criterias for creating a trigger on a view ????

     

  • SQL 2000 BOL says that you can only create INSTEAD OF triggers on views and then only if the view was created without the WITH CHECK option.  INSTEAD OF triggers fire instead of the operation that caused the trigger to fire, probably not what you want.  Is it possible for you to put the triggers on the underlying tables?

    Aunt Kathi Data Platform MVP
    Author of Expert T-SQL Window Functions
    Simple-Talk Editor

  • Here's an article that may give the answer you are looking for: http://www.microsoft.com/technet/prodtechnol/sql/2000/reskit/part10/c3761.mspx

    It describes using INSTEAD OF triggers to allow updates to multiple tables through a view.

    Aunt Kathi Data Platform MVP
    Author of Expert T-SQL Window Functions
    Simple-Talk Editor

  • thx

    i thought is was to good to be true

    i gess i will write the trigger on the derived tables

    unless someone knows how i can run a batch file when a view is updated

    ( i didnt find it in the article )

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply