|
Hi all,
I am using Visual Studio 2008 and Sql Server 2005
I am use some CLR Programming in my windows application and it goes fine.
But I got Some Error during Transaction in my application.
Error : Transaction (Process ID 55) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
So, What is the Problem and How Can I Solve this Type of Problem.
Thanking you very much.
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
For deadlock descriptoin, see:
- http://en.wikipedia.org/wiki/Deadlock[^]
- Deadlock[^]
In order to prevent a deadlock you must for example ensure that operations (and lock acquisitions) are executed in the same order, everywhere. This won't prevent all situations, but the amount will be much smaller.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
In your code check the exception, if it is sql exception, then instead of skipping the control, stop the process for some time and call the same functionality once again, by the time, other process will finish it's work and release the data, then you process will continue
ch sriniw8z
|
|
|
|
|
I suppose you didn't actually want to answer my post, but the original question. When answering a question (or another post), press reply on the post which you want to answer or comment.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
True Dat!
Easy to implement when the DB is new and there aren't that many queries, sps, etc.
On an existing database with alot of objects, little hard to implement. Lack of fore thought will kill you later on a large database with deadlocks/delaylocks.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
That's true. One basic rule is to make operations top-down in relational order. It's quite simple rule of thumb, but works in many cases.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
I want to know new values.
I have table
-------------
Names
-------------
A
B
C
now i have data
S,W,B
I want to know that S and W are new or these are not registered in our database.
Any query that help me.
Thanks.
Syed Shahid Hussain
|
|
|
|
|
Something like this...
SELECT 1 FROM Table WHERE Names = 'S'
|
|
|
|
|
This is a situation perfect for a LEFT OUTER JOIN or the NOT IN operator.
select n2.Names
from names_original n1
left join names_new n2 on n2.Names = n1.Names
where n1.names is null
OR
select n.Names
from names_new n
where n.Names not in (select names from names_original)
Of the two, I prefer the LEFT OUTER JOIN; but they should both produce the desired result
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi ,
I have a problem with importing database from local system to web hosting server.
can you Please tell me the steps to import database from local machine to web hosting server.I am using Sql Server 2000 in my system.can we import database without using Business intelligence development.
If anyone have any idea please solve my problem.
Thanks in advance
Pavani
|
|
|
|
|
If I understood the question correctly, why not simply take a backup from local system and restore it to hosting server.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Thanks for your Reply.
I have taken backup for my database but how can we restore it to hosting server. Please can you tell me the steps to restore the database to Web hosting server.
|
|
|
|
|
|
Hi,
I followed that article, now i can restore it into my local system.But i am not getting how to import it to Web hosting server.Please tell me clearly.
|
|
|
|
|
I don't understand your question.
If you can restore the database to you local host, take the backup files to another server and do the same restore operation on that server.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
hi,
I am developing advertising website.whenever I am getting impression that time i am geeting timeout expired error is comming because at a time somany impressions are comming..here I am using stored procedure..if anybody knows for improve this performance...please reply me...
Thanks.
Raaj
|
|
|
|
|
You need to look at your indices amongst other things. Try using the Actual Execution Plan in Query Analyser to identify where there are problems and take it from there.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
sometimes I am getting impression....sometimes timeout expired..
Raaj
|
|
|
|
|
index will help with this issue?
Raaj
|
|
|
|
|
r aa j wrote: sometimes I am getting impression....sometimes timeout expired..
So you need to understand where your query is taking too long. Check the execution plan as I said. Nobody can do it for you, and nobody can guess whats wrong - except its probably index related.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
please tell me how can we check the execution plan.
Raaj
|
|
|
|
|
Run your stored proc in query analyser, check the Query menu options to turn on Include Actual Execution Plan.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I done that Execution plan.actually that storedprocedure contains 7 queries....for that execution plan its display query cost one 8% ,another 23% etc....
please can u tell me how we can identify
Raaj
|
|
|
|
|
Its at this point you need to consult the help. Once you understand what the execution plan is telling you it will enable you to make the necessary changes. You can try taking the individual queries and putting them into the "Analyse Query In Database Tuning Advisor" Query menu item. This will give you some hints at what could be done.
Alternativley you could hire someone who understands sql server performance tuning.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
thanks for ur suggestion....
thanks alot
Raaj
|
|
|
|