Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
pipi
Starting Member
18 Posts |
Posted - 2005-08-05 : 02:18:06
|
| Goodmorning!Do you know if sqlserver lock the database even if i execute a select statement( a simple select *),not update or delete. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-05 : 02:23:10
|
| Yes. Thats known as Shared Lock and it will lock only that table and not the databaseIf you want not to lock the table you can apply NoLock hintSelect * from yourtable(NoLock)MadhivananFailing to plan is Planning to fail |
 |
|
|
Stalker
Yak Posting Veteran
80 Posts |
Posted - 2005-08-05 : 07:44:08
|
| >>and it will lock only that table and not the databaseactually there is also shared lock on the database |
 |
|
|
paulrandal
Yak with Vast SQL Skills
899 Posts |
Posted - 2005-08-05 : 11:20:28
|
quote: Originally posted by Stalker >>and it will lock only that table and not the databaseactually there is also shared lock on the database
Yup - all connections to a db take a shared lock to stop it being dropped or put into single-user mode (unless forced).Paul RandalDev Lead, Microsoft SQL Server Storage Engine(Legalese: This posting is provided "AS IS" with no warranties, and confers no rights.) |
 |
|
|
|
|
|