title: Multi-line SQL query using bcp in batch
body: <p>I've created a batch file that outputs data from a series of SSMS queries using bcp.  </p>
  
  <p>For readability and maintenance, I'd like to set each query as a variable spanning multiple lines, which I'd reference within the bcp call, such as:</p>
  
  <pre><code>SET myQuery = 
  "select a, b, c, d "
   "from tableA a "
   "inner join tableB b "
   "on a.Id = b.ID "
   "where a.value &lt; .99 "
   "order by a.Id " 
  
  
  bcp %myQuery% queryout C:\myDir\filenameOut.txt -S ServerName -T -c
  </code></pre>
  
  <p>I'd found the carat operator for doing something similar, and applied as such:  </p>
  
  <pre><code>SET myQuery = 
  "select a, b, c, d " ^
   "from tableA a " ^
   "inner join tableB b " ^
   "on a.Id = b.ID " ^
   "where a.value &lt; .99 " ^
   "order by a.Id "
  </code></pre>
  
  <p>to no avail.  Error message says:</p>
  
  <blockquote>
    <p>"[first line contents] is not recognized as an internal or external
    command, operable program or batch file."</p>
  </blockquote>
  
  <p>which makes me think the lines aren't being concatenated properly.  </p>
  
  <p>I realize batch files generally don't play well with multi-line operations like this, but is there a straight-forward method for achieving this?</p>