Results 1 to 29 of 29

Thread: Opinions - with MS SQL Server - how do you lock?

Hybrid View

  1. #1
    Addicted Member
    Join Date
    Jun 2005
    Posts
    139

    Re: Opinions - with MS SQL Server - how do you lock?

    Sorry..TG u r right. I dont know what I was thinking when I wrote that.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Opinions - with MS SQL Server - how do you lock?

    I've edited my sample, what would be the value of Field1 with each scenario I've given? Specially at the same millisecond, will it differentiate them through nanoseconds? And what if they are also executed at the same nanosecond?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Opinions - with MS SQL Server - how do you lock?

    Quote Originally Posted by dee-u
    I've edited my sample, what would be the value of Field1 with each scenario I've given? Specially at the same millisecond, will it differentiate them through nanoseconds? And what if they are also executed at the same nanosecond?
    With a SQL database there is nothing being executed at the same exact time. Everything is sequentially processed - every request for ACTION is put into the LOG file for processing. If the LOG file has two requests to update the same row in it - one will be first, and one will be second - that is the nature of the sequential processing of the LOG file.

    If the LOG file indicates that the row the second UPDATE is attempting to touch is locked, the the second ACTION request in the LOG file will hold until the first request processes OR is will deadlock and timeout.

    There is no such thing as two requests occuring at the same time. Remember that a single program called SQLSERVER.EXE is taking each ADO request for ACTION on the DATABASE and processing them sequentially.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width