ASP Error Message

I have a custom error message page that emails me when an error is encountered by a visitor.  I am receiving following error message on some of the pages on my site, although to my knowledge it is not crashing the page for the end user???  Is that possible and how do I fix it?

[Microsoft][SQL Server Native Client 10.0][SQL Server]Transaction (Process ID 59) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

Thanks!!
Bob SchneiderCo-OwnerAsked:
Who is Participating?
 
Scott Fell, EE MVEConnect With a Mentor Developer & EE ModeratorCommented:
It sounds like multiple inserts are going on at the same time.

Does your database take a long time to do what it needs to do or do you have a bunch of loops or extracting more data fields then you need?  I just gave a response to somebody else about using getrows instead of do until rs.eof.

if not rs.eof then
     MyArray=rs.getrows()
end if
'close database

' now loop through the array

anything you can do to make it run faster especially if you are on a shared servicer or server with low memory/cpu.
0
 
Umar TopiaConnect With a Mentor .Net Full Stack DeveloperCommented:
You can do the following to avoid deadlocks and locks on tables:

1) Replace Cursors with While Loops in SQL Server
2) Replace Temp Tables with Table Variables in Stored Procedures in SQL Server
0
 
Bob SchneiderCo-OwnerAuthor Commented:
Padas, that was me that you gave the advice to.  I will try to implement that here.  Wasn't sure that the same solution would prevent this issue from happening.
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Well I use it all the time  now!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.