deadlock

  • I seem to be getting locked when i try to do a select  on a table that been updated /inserted by another user. Is there a way i can explicitely say the table to be shared for read puproses when it is updated/inserted. Can anyone shed some light on this.

    TIA

  • Use lock hint (nolock) in your select statement.

  • Thanks Allen,

    Can this lock be used in insert/update statements. If so can you pl jott down the consequences/impact of this too.

    Thanks

  • No. SQL Server will place exclusive lock to the row or page or even database when it does insert/update.

  • Try this dude,

    Let's say someone inserted or updated a table called TmpTable, and you want to select from that table.

    You can try to issue a Select statement with the keyword (NOLOCK).

    Here is the sample,

    SELECT * FROM TmpTable WITH (NOLOCK)

    WHERE blah~~~

     

    Hope it help.

  • Hi,

    Just wondered what causes the lock ( that i'm interested in !!)

    Wrong insert / update statement?

    Howmany rows are involved?

    How is your page handling ( pageiolatch )?

    System - database specs?

    etc etc.

    Rather find out what had happened as creating a work arround !!

    Please specify.

     

     

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply