Posted by Alex Kuznetsov on 06/21/07 01:28
On Jun 20, 5:01 pm, "Neil" <nos...@nospam.net> wrote:
> > Never heard of it. Revoke delete permissions from all your users. Add
> > a trigger prohibiting any deletes.
>
> If I add a trigger prohibiting any deletes, then it wouldn't be possible for
> me to go in and delete a record if I ever needed to, right? Or is there a
> way to set up a trigger so that it can allow the delete in some cases?
>
> Thanks.
You can disable the trigger for the duration of your delete.
Alternatively you can have you trigger allow you to do whatever you
want, based on user_id() or suser_id(). Trigger can be bypassed using
nested triggers and or recursive trigger setting. There are other ways
best described in T-SQL Programming by Itzik Ben-Gan.
http://sqlserver-tips.blogspot.com/
[Back to original message]
|