title: Microsoft Access Pivot table to SQL Server Pivot Table
body: <p>I am new to SQL Server and need to convert the following MS Access Pivot query to SQL Pivot Query.  Any help would be greatly appreciated.</p>
  
  <pre><code>TRANSFORM First(msdgen_pmcat_document_extract_mats.document_text) AS FirstOfdocument_text
  SELECT msdgen_pmcat_document_extract_mats.material_id, msdgen_pmcat_document_extract_mats.documentobject_name, msdgen_pmcat_document_extract_mats.regulatory_code, msdgen_pmcat_document_extract_mats.alternate_name
  FROM msdgen_pmcat_document_extract_mats
  GROUP BY msdgen_pmcat_document_extract_mats.material_id, msdgen_pmcat_document_extract_mats.documentobject_name, msdgen_pmcat_document_extract_mats.regulatory_code, msdgen_pmcat_document_extract_mats.alternate_name
  PIVOT msdgen_pmcat_document_extract_mats.data_type_code;
  </code></pre>