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]
- 1HT201077 I have windows 8.1 and ios7. contacts and calendar stopped streaming to my laptop but was ok on ipad and iphone. That problem fixed but now photos stopped streaming to laptop. Any suggestions 10-11
- 2Problems with video. 10-11
- 3Aperture 3 and Sinar STI raw files 11-30
- 4Updating itunes is taking round in circles! HELP! 11-30
- 5Problem in query not getting desired output . 11-30
- 6Oracle Discoverer Desktop truncate at least 10.000 rows 11-30
- 7Word processing using cental european language 11-30
- 8Doubt in any file to any file 11-30
- How can I connect my MBP to other devices?10/11
- What are settings required in FICO for state bifurcation(AP&TG)10/11
- Anybody using an Apple wireless mouse on the Mac Mini ?10/11
- Dbms_alert package10/11
- System users in XI.10/11
- Scanned document printing too small10/11
- Requirement of an alternative material11/30
- What is Cost Center and Activity type11/30
- 2.0 projects open in 1.5?11/30
- RA01 (Discount % on gross) condition type11/30