title: tsql : how do you query with dashes in column names?
body: <p>I have the query </p>
  
  <pre><code>select * from products p, products_temp t 
  where p.ManufacturerPartNumber = t.[INV-PRICE-VENDOR-PART]
  </code></pre>
  
  <p>where the column names have dashes in them which SQL Server 2005 seems to automatically add brackets to.  What is the correct way of accessing this in a query? I've tried with brackets and without the brackets and just end up with errors.  </p>
  
  <p>the error I get from sql mgmt studio is </p>
  
  <pre><code>Msg 156, Level 15, State 1, Line 2
  Incorrect syntax near the keyword 'where'.
  </code></pre>
  
  <p>thanks in advance</p>