Should I be using SQL transactions, while reading records?

后端 未结 7 1682
离开以前
离开以前 2021-01-02 09:14

SQL transactions is used for insert, update, but should it be used for reading records?

7条回答
  •  佛祖请我去吃肉
    2021-01-02 09:58

    It's posssible to to do transactions but what is purpose of it?

    You can set the appropriate isolation level for an entire SQL Server session by using the SET TRANSACTION ISOLATION LEVEL statement.

    This is the syntax from SQL Server Books Online:

    SET TRANSACTION ISOLATION LEVEL 
        {
            READ COMMITTED 
            | READ UNCOMMITTED 
            | REPEATABLE READ 
            | SERIALIZABLE
        }
    

    Locking in Microsoft SQL Server.

提交回复
热议问题