Tuesday, March 27, 2012

deadlocks

Hi,
I have an application that has reported deadlocks on the
sql server. I ran a profiler on it to capture deadlocks.
Can anyone indicate the best way to prevent deadlocks, any
sites and ideas, any advice would be welcome!
Thanxs!To prevent deadlocks.
1. Access resources in the same order... Choose an order for tables, and
have everyone use the tables in the same order .
2. Keep your transactions short... The longer your transaction , the longer
locks are held, the more likely you will bump into someone in this bad way..
--
Wayne Snyder MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
(Please respond only to the newsgroups.)
I support the Professional Association for SQL Server
(www.sqlpass.org)
"claudy" <anonymous@.discussions.microsoft.com> wrote in message
news:095b01c3c3d3$69d023f0$a401280a@.phx.gbl...
> Hi,
> I have an application that has reported deadlocks on the
> sql server. I ran a profiler on it to capture deadlocks.
> Can anyone indicate the best way to prevent deadlocks, any
> sites and ideas, any advice would be welcome!
> Thanxs!
>|||It would be useful to provide trace when writing on deadlocks, because it can occur on single page as well in one select and another ,for example, delete statement. In this situation only indexing strategy can help
Use dbcc traceon (1204) from Query Analyzer to create trace in SQL Log filsql

No comments:

Post a Comment