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 |
|
Mehdi
Yak Posting Veteran
64 Posts |
Posted - 2009-01-19 : 03:04:08
|
| Hi,I have sp which calculating huge amount of data so it take lots of time during the execution i need to lock some tables, even no select query should be run on those tableswhich command should i use?tanks._____________Mehdi.software student. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-19 : 03:20:26
|
| use xlock & paglock |
 |
|
|
Mehdi
Yak Posting Veteran
64 Posts |
Posted - 2009-01-19 : 04:05:27
|
quote: Originally posted by visakh16 use xlock & paglock
how to use them in a strode procedure on different tablesI am runingcreate proc CalculationProcessas//i need to lock tbl1 here//i need to lock tbl2 here //doing some process on tbl3select * from tbl3 where....//i need to unlock tbl1 and tbl2 here_____________Mehdi.software student. |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2009-01-19 : 04:26:57
|
| Why do you want to lock table1 and table2 when you're doing processing on table3? How are they related?--Gail ShawSQL Server MVP |
 |
|
|
Mehdi
Yak Posting Veteran
64 Posts |
Posted - 2009-01-19 : 04:41:03
|
quote: Originally posted by GilaMonster Why do you want to lock table1 and table2 when you're doing processing on table3? How are they related?--Gail ShawSQL Server MVP
well this is for a stock managing puprose,tbl3 has some info about the goods and the number of them tbl2 and tbl1 has info on assingnments and bills of the importing and exporting goods to stockrooms while i am claculating the amount of imported and exported for determinig the probable frauds of a good on tbl3 the user should not get info from tbl1 and tbl2 or update them. |
 |
|
|
|
|
|