Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking tables in SQL SERVER

Status
Not open for further replies.

tsherfy

Programmer
Dec 23, 2000
20
US
We are converting from an Oracle database to SQL Server. Does anyone know what the SQL Server equivalent of the following Oracle statement"Lock Table xxx In Exclusive Mode"?

 
You can use the lock hints in SQL statements.

Select * From MyTabel with (tablockx, holdlock)

Update MyTable with (tablockx, holdlock)
Set col1='abc'
Where col2=7

tablockx performs an exclusive lock. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top