Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-05-26 : 08:58:34
|
| Alvin writes "HiI am having issues when the same SQL queries run simultaneously from diiferent ASP App threads is getting deadlocked.The deadlock is for a query, which calls a Stored Proc. The stored Proc has a transaction, inside of which it does the followingAlter Proc DoSomethingBEINGBEGIN TRANSACTION TRAN1SELECT * from TABLEA -- captures values in local variablesDELETE from TABLEAINSERT into TABLEB -- values captured from TABLEACOMMIT TRANSACTION TRAN1SELECT @V1, @V2 from TABLEA -- same as in first stepENDIt is the DELETE that is causing a DeadlockWould really appreciate help on thisThanksAlvin" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2006-05-26 : 09:00:31
|
| Why are you deleting the entire table? Why are you "capturing values into local variables" if you're going to insert them all into the other table.It would be better to post your actual code, not some generalized example. As written now (which doesn't work) you will not be able to avoid deadlocking. |
 |
|
|
|
|
|