March 19, 2007 at 3:53 pm
Hi, I have an appliction which run the following two SQLs in the order:
1.INSERT INTO tab1 WITH (ROWLOCK)
2.DELETE from tab1 WITH (ROWLOCK)
This appliction is executed by hundreds of users at the same time. Normally these SQLs only takes less than 1 seoncd. Sometimes I saw significantly delay on these SQLs - around 10 seconds. It seems that they are blocking each other (when updating clustered index?), is there a way to solve this conflict?
Thanks
March 20, 2007 at 1:15 am
Use Transactions is better then rowloc
begin tran
1.INSERT INTO tab1
2.DELETE from tab1
commit tran
regards
john
March 20, 2007 at 10:06 am
Do you really execute the DELETE with no WHERE clause? That simply can't be good/right. And if it is, then you certainly don't want rowlock hint specified.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
March 20, 2007 at 8:23 pm
I believe adding the transaction increases the chances of a deadlock... better to let it wait than to form deadlocks.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply