Tuesday, March 27, 2012

Deleting Records - Same DB at the Same Time

I have two processes that could potentially delete
different records from the same database at the same
time. Every time this happens the process errors out
saying that the delete operation could not be performed
due to the table being locked. Do you have any
recommendations on how to work-around this? Thanks.Find out how the DELETE statement is written (the WHERE clause) and make sure you support that WHERE
clause with an appropriate index. This increases the chance that SQL Server will work with row locks
instead of page or even table locks.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Renita" <anonymous@.discussions.microsoft.com> wrote in message
news:81e901c3e992$2ad699b0$a101280a@.phx.gbl...
> I have two processes that could potentially delete
> different records from the same database at the same
> time. Every time this happens the process errors out
> saying that the delete operation could not be performed
> due to the table being locked. Do you have any
> recommendations on how to work-around this? Thanks.
>

No comments:

Post a Comment