title: NOLOCK IN temp tables
body: <p>I declared a table in my procedure which you can see below:</p>
  
  <pre><code>Declare @resultTable Table
  (
    EmpId int,
    EmpStatusId int,
    CreatedDateTime datetime
  )
  </code></pre>
  
  <p>and i perform a delete function:</p>
  
  <pre><code>Delete From ActualTable
  Where Id = (Select EmpId from @resultTable with (nolock) where EmpStatusId = @tempId)
  </code></pre>
  
  <p>i am trying to avoid locking in the select statement to avoid deadlock even if i read a dirty data. However, "with (nolock)" is not allowed. The error says: </p>
  
  <blockquote>
    <p>Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.</p>
  </blockquote>
  
  <p>Is there a way to apply NOLOCK in a temporary table?</p>