Microsoft KB Archive/45582

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 19:23, 12 August 2020 by X010 (talk | contribs) (X010 moved page Microsoft KB Archive/Q45582 to Microsoft KB Archive/45582 without leaving a redirect: Text replacement - "Microsoft KB Archive/Q" to "Microsoft KB Archive/")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

INF: Writing Efficient Queries and Stored Procedures ID Number: Q45582

1.10 1.11 4.20 OS/2

Summary:

To write efficient queries and stored procedures, you should use BEGIN TRAN in read-only transactions.

HOLDLOCK causes all share locks to be held for the duration of the logical unit of work (until the commit), instead of just until the end of the SELECT statement. This can be used to prevent other users from updating the entire set of rows read by a transaction in order to provide a consistent image of the database to that transaction (Gray’s consistency level 3, or “repeatable read”).

Additional reference words: Optimization and tuning