Prevent Record Locking

Last Post 03 Apr 2014 06:02 AM by gunneyk. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
drnec
New Member
New Member

--
02 Apr 2014 07:50 AM
I have the need to access data on a production server. The process will be read only. The database owner is worried that my access will somehow create a record lock and possibly impact his processing do to a lock.

I'm of the belief that my access can be set up so that locking does not occur, however I'm far from being a DBA, I'm just a lowly user.

Is there a way the database owner can insure that my access won't lock any records.

Thanks,
Drnec
rm
New Member
New Member

--
03 Apr 2014 05:15 AM
Yes, you can use nolock hint in your query if dirty read is fine with you.
drnec
New Member
New Member

--
03 Apr 2014 05:41 AM
rm:
thanks for the response. I'll look into the nolock. What I was really looking for is a way that a dba could limit my access to prevent me from locking.

Thanks,
Drnec
gunneyk
New Member
New Member

--
03 Apr 2014 06:02 AM
I don't know of a way for the DBA to prohibit you from taking any locks other than having him grant you read only access to those database objects which is what he should do. However that doesn't prevent you from taking out shared locks when you read. As rm stated you can use NOLOCK hints in your queries or issue this immediately after making each connection to the db.

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

This will prevent shared locks but does not top you from doing updates. That is where the db object access permissions come into play.
You are not authorized to post a reply.

Acceptable Use Policy