instead of trigger to fulfill need to delete table before data is inserted

  • I have a process that is already inserting data to a table, I have a trigger after insert that copies the information from the one table to an archive table, however, I need to delete the data that is currently in the table before the insert happens.

    Coming from an oracle background, the before insert would work perfect, how can you do the instead of predicate to accomplish the same thing?

  • [font="Verdana"]I don't know whether it is logical, and even I didn't tried such thing yet, can you write delete statement inside the trigger for deleting the records from table on which you have written trigger?

    Mahesh[/font]

    MH-09-AM-8694

  • This is a duplicate post. No more responses here please. Respond to:

    http://www.sqlservercentral.com/Forums/Topic786113-338-1.aspx

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

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

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