Re: Sql Server Locks
- From: "Andrew J. Kelly" <sqlmvpnooospam@xxxxxxxxxxxx>
- Date: Tue, 15 Nov 2005 22:54:55 -0500
Why are you deleting and then adding them back in instead of simply Updating
them in place? In any case you must ensure you have a valid index
(preferably a Primary Key) that Sql Server can use to identify the
individual rows. What Isolation level are you using? If it is serializable
you should consider using Read Committed instead. Also make sure the Begin
Tran and Commit Tran are as close together as possible and the transactions
as short as possible.
--
Andrew J. Kelly SQL MVP
"Prasad Dannani" <prasad@xxxxxxxxxxxxx> wrote in message
news:%239RdyPe6FHA.2608@xxxxxxxxxxxxxxxxxxxxxxx
> Hi All,
>
> We have various processes running symultaniously but no two processes will
> access the same record and each process is in a seperate transaction.
>
> The problem is with SQL Server Database Locks.
> i.e. if we access any query in two different transactions then one is
> getting success and the next one is failing.
>
> Example Scenario:
> First process is running for Client "A": This will delete records of
> client A and reinserts the same with some data changes
> First process is running for Client "B": This will delete records of
> client B and reinserts the same with some data changes
>
> In this example the code is same for two clients and the tables accessed
> also same. we are tried with out locks and using row locks but nothing is
> working.
>
> Suggest us which is the best locking option for this kind of scenarios and
> provide us any good links for this kind of scenarios.
>
> With Regards,
> Prasad Dannani
>
>
>
.
- References:
- Sql Server Locks
- From: Prasad Dannani
- Sql Server Locks
- Prev by Date: Users Access?
- Next by Date: Re: problem trying to save a date field
- Previous by thread: Sql Server Locks
- Next by thread: Re: Sql Server Locks
- Index(es):
Relevant Pages
|