Avoiding row deletion with a trigger

  • Hi everybody,

    I'm moving from Borland Interbase and I'm a newby in SQL Server.

    I have a table with a column that hold the user name of the user that inserted the row. I need to implement a function that, when someone tries to delete one row in the table, verifies if the user who want to delete is the same that created the row. If not I need to cancel the action.

    Do you think this can be done with a INSTEAD OF trigger ? If not what technique do you recomend ?

    Thank you in advance

    Best regards

    João Miguel

  • This was removed by the editor as SPAM

  • An INSTEAD OF trigger should work.  Check out "Designing INSTEAD OF Triggers" in BOL.

    There is no "i" in team, but idiot has two.
  • Thank you Dave,

    I will read the BOL section to try to do it.

    Best regards

    João Miguel

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

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