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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lock table

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
hi guys

i want to how i can lock the table in sql server
thanks & regards


m.khaleel
 
Why do you want to lock an entire table? This is usually a bad thing.

But if you really want to, you can do it like this:
[tt]
SELECT name FROM customers WITH (TABLOCK)
[/tt]
which will lock the table for the duration of the statement. You can find out more in Books Online under "locking, table-level"

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top