views:

23

answers:

1

In SQL Server 2005, is it possible to automatically set transaction isolation level to, say, read uncommitted an a per-user basis?

(So for instance, if I set such a login option for user Fred, Fred wouldn't have to remember sprinkle his select statements with NOLOCK hints or remember to add in a set transaction isolation level statement to his sql.)

+1  A: 

if it is for stored procs you could have code like this in the procs

if user_name() in('dbo','username','otherusers','bla') 
set transaction isolation level read uncommitted
else
set transaction isolation level read committed

But of course now you have a maintenance problem, all current procs have to be modified

you can also check with suser_sname() but this really becomes a big PITA

you might also be able to use a LOGON Trigger I have not tried and am not sure it will work

SQLMenace
I'll investigate the trigger option. Not exactly what I'd hoped, but it might do the trick -- thanks!
Ewen Cartwright