hi guys,
I just wanted to know how to do a row level locking when it comes
to some thing like this.
I do a begin transaction and I change a row. Now for another user that whole
table is locked, is there any way to lock only the modified row using some
kind of SQL Server setting by default ?
Thanks in advice and help
-SniperHi
This is a DEFAULT (Row Locking) that SQL Server does.
"Sniper" <kakopappa@.hotmail.com> wrote in message
news:22D6AC95-3F66-4EE1-A2DB-C4624FD30838@.microsoft.com...
> hi guys,
> I just wanted to know how to do a row level locking when it
comes
> to some thing like this.
> I do a begin transaction and I change a row. Now for another user that
whole
> table is locked, is there any way to lock only the modified row using some
> kind of SQL Server setting by default ?
>
> Thanks in advice and help
> -Sniper|||Hi
If the other user's query needs to look at the row that was updated (bacause
no suitable index is available so a table scan is required, or a range scan
is required), until you release the lock, the other query can not complete.
Regards
Mike
"Uri Dimant" wrote:
> Hi
> This is a DEFAULT (Row Locking) that SQL Server does.
>
>
> "Sniper" <kakopappa@.hotmail.com> wrote in message
> news:22D6AC95-3F66-4EE1-A2DB-C4624FD30838@.microsoft.com...
> comes
> whole
>
>|||Hi
Thanks for your guys reply,
if it's does a row lock then why when I do a select * from table it waits
till lock to be release?
"Mike Epprecht (SQL MVP)" wrote:
> Hi
> If the other user's query needs to look at the row that was updated (bacau
se
> no suitable index is available so a table scan is required, or a range sca
n
> is required), until you release the lock, the other query can not complete
.
> Regards
> Mike
> "Uri Dimant" wrote:
>|||Sniper
Because SQL Server reads the data from data page rather than from an index
page. Specifying SELECT * FROM, SQL Server returns a data from all
columns which some of them don't covered by index.
SELECT col FROM Table (I assume you have an index on col) you won't waiting
till SQL Server realeses the lock because it reads from an index page.
"Sniper" <kakopappa@.hotmail.com> wrote in message
news:F7518372-B99C-420E-9F63-8DB42A428887@.microsoft.com...
> Hi
> Thanks for your guys reply,
> if it's does a row lock then why when I do a select * from table it waits
> till lock to be release?
>
> "Mike Epprecht (SQL MVP)" wrote:
>
(bacause
scan
complete.
it
that
using some
No comments:
Post a Comment