title: how to use single quotations inside a transact sql statement
body: <p>i want use single quotations inside a transact sql statement, then execute that statement.</p>
  
  <p>for example my query is:</p>
  
  <pre><code>Select * FROM MyTable WHERE MyTable.Id = '1'
  </code></pre>
  
  <p>now i want use like this:</p>
  
  <pre><code>Declare @SQLQuery AS NVarchar(4000)
  SET @SQLQuery = ' Select * FROM MyTable WHERE MyTable.Id = '1' '
  Execute (@SQLQuery)
  </code></pre>
  
  <p>this not work, and this error occurred : </p>
  
  <blockquote>
    <p>Invalid column name '1'</p>
  </blockquote>
  
  <p>I know problem is quotations in left and right side of the 1</p>
  
  <p>this is a sample and i want use of this way to a large query</p>
  
  <p>of course, i want use local variable instead for example '1' and my local variable is varchar</p>
  
  <p>any idea?</p>