title: Sql FOR XML PATH returns Incorrect Syntax near 'PATH'
body: <p>This seems like this should be really simple, but I don't see what's wrong.</p>
  
  <pre><code>DECLARE @companies TABLE(
      [companyId] SMALLINT        
  )
  
  INSERT INTO @companies
     SELECT TOP 3 tc.CompanyID AS 'companyId'
     FROM dbo.tblCompanies tc
  
  SELECT * 
  FROM @companies c
  </code></pre>
  
  <p>This query returns this data.</p>
  
  <pre><code>companyId
  ---------
    1
    2
    3
  </code></pre>
  
  <p>When I try to use FOR XML, these work:</p>
  
  <pre><code>-- this works
  SELECT  companyId
  FROM @companies [company]
  FOR XML AUTO
  
  -- this works
  SELECT  companyId
  FROM @companies [company]
  FOR XML RAW
  </code></pre>
  
  <p>But this returns an error </p>
  
  <blockquote>
    <p>Incorrect syntax near 'PATH'</p>
  </blockquote>
  
  <p>and I can't figure out why.</p>
  
  <pre><code>-- why doesn't this work?
  SELECT companyId
  FROM @companies
  FOR XML PATH('company')
  </code></pre>
  
  <p>What am I missing?</p>