View or function is not updatable because the modification affects multiple base tables

  • Hi There,

     

    I am trying to do a csv import of some data into a view. The view outer joins two different tables together, and I have made an INSTEAD OF INSERT trigger on the view to accommodate this. However, when I run bcp or BULK INSERT I get the error:

    View or function 'XXX' is not updatable because the modification affects multiple base tables.

    Any ideas about how to fix this?

     

    Thanks a lot

     

    Jamie

  • This was removed by the editor as SPAM

  • You need to use INSTEAD OF UPDATE trigger as well.

  • Imran Nazir (2/1/2014)


    You need to use INSTEAD OF UPDATE trigger as well.

    I realize that you and I are responding to an 8 year old post but I wouldn't do this through a view. You're going to have to write a bunch of code in the INSTEAD OF triggers anyway. Import the data into a proper staging table and then write code to both validate and distribute the data.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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