View Single Post

   
  #2 (permalink)  
Old 02-29-2008, 07:09 AM
David Portas
 
Posts: n/a
Default Re: prevent DELETE and/or UPDATE

I don't understand this statement:

> The "problem" with rights is that they dont apply to all DB-users".


You can set DB permissions for whatever users you like. True, you can't
stop sysadmins from updating tables but that's not possible with
triggers or any other method either. Nor would it be a good idea since
corrective maintenance may be part of a DBA's role.

The problem with attempting to do this in a trigger is precisely that
there isn't an easy way to circumvent the trigger for ad-hoc
maintenance purposes without affecting all other users. A Trigger
containing only a RETURN statement should do for this if you must.

However, if you enforce the sensible practice of denying users all
permissions on tables and then performing updates only through procs
you won't have this problem.

--
David Portas
SQL Server MVP
--

Reply With Quote