Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created March 25, 2014 00:07
Show Gist options
  • Save bennadel/9752196 to your computer and use it in GitHub Desktop.
Save bennadel/9752196 to your computer and use it in GitHub Desktop.
SQL Server NOLOCK / ROWLOCK Directives To Improve Performance
SELECT
b.id,
b.name,
( t.id ) AS tag_id,
( t.name ) AS tag_name
FROM
blog_entry b
INNER JOIN
blog_entry_tag_jn btjn (NOLOCK)
ON
b.id = btjn.blog_entry_id
INNER JOIN
tag t (NOLOCK)
ON
btjn.tag_id = t.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment