Truncate table lock issue
In my SQL2000 stored procedure, there are 9 truncate table commands.
But the the stored procedure is take above 15 minutes to execute.
In this stored procedure, truncate table command has no problem.
But an insert query into that table is very slow.
In the insert query, select some views output and insert into the table. But these select output is very slow.
I search some forums. They said that lock problem for the object. Query execution delayed for a exclusively accessed object.
How can I remove the lock for my strored procedure running faster ?
AdvertisementHere are the bad news: you need to have some understanding of indexing to get some results out of it. But since we don't know anything about your queries, we cannot really give much better advice. What we can say is that TRUNACTE TABLE has nothing to
do with it. Probably not locking either. Locking would come from concurrent activity in the database. Is there any?
Normally, we ask people to submit the code they have problem with. In this case we would also need see the view definitions. (Else we would still be in the dark.) And if the views are built on views, we need to see these as well. This may result in more
code that is practic to handle here, but I leave that up to you. As a hint: in the next step we are much likely to ask for the table and index definitions.
Erland Sommarskog, SQL Server MVP, [email protected]
- 1Transferring ipod's music to itunes library...please help 10-11
- 2I have a Macbook Pro and a HP 5510 printer. And suddenly a problem printing. 10-11
- 3When will the releases announced at NAB be available 11-30
- 4Wage type amounts in cluster PCL4 11-30
- 5How to generate 10K invoices per day ? 11-30
- 6Passing a Date variable to SQL 11-30
- 7How to I resize screen resolution in internet browser? 11-30
- 8No Import command 11-30
- Mass change in scheuled quantity in Scheduling Agreement10/11
- IDOC to FILE Scenario-Error in defining Adapter specific Identfier10/11
- Can you create an image map that will link to a different element on the same page?10/11
- Flash element - change pointer from arrow to hand in Director10/11
- Finding photos after upgrade to 7.1.1 by location on a map10/11
- Script to map default printer based on user input11/30
- BPC 7.0NW installation error11/30
- Connect two paths11/30
- Database upgrade confusion11/30
- A general question only regarding math and computer11/30