title: SQL Server XML Attribute Shredding
body: <p>I'm currently running SQL Server 2014 and need to shred out attributes/sub attributes from a provided XML string, creating columns for Age, Color, Seating, and Transmission Type:</p>
  <pre><code>DECLARE @XmlInput xml;
  SELECT @XmlInput = '&lt;Cars&gt;&lt;Car Description=&quot;(Camry) {Age=2, Color=Blue, Seating=5, TransmissionType=Automatic}&quot;/&gt;&lt;Car Description=&quot;(Fusion) {Age=4, Color=Red, Seating=5, TransmissionType=Automatic}&quot;/&gt;&lt;/Cars&gt;';
  SELECT x.y.value('(@Description)[1]','varchar(1000)') AS CarDescr FROM @XmlInput.nodes('/Cars/Car') AS x(y);
  </code></pre>
  <p>I verified with the sender that this is the only way they can send XML without large workarounds on their end so I am stuck with the given XML format.</p>
  <p>Edits:
  I am looking for a return data set with a column for age, a column for color, a color for seating, etc.</p>
  <p>I am running on SQL Server version: Microsoft SQL Server 2014 (SP2-GDR) (KB4057120) - 12.0.5214.6 (X64)   Jan  9 2018 15:03:12   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.3  (Build 9600: )</p>