title: Want to store XML in SQL Server 2014 table and apply select on same
body: <p>Having data in the for of XML and I want to store that XML in a SQL Server table. I have created a column of datatype <code>xml</code> and tried to store my XML data in that newly created column, but I get an error on <code>INSERT</code>:</p>
  
  <blockquote>
    <p>The data type 'xml' used in the VALUE method is invalid.</p>
  </blockquote>
  
  <p>This is the <code>Insert</code> statement:</p>
  
  <pre><code>INSERT INTO UserDeatailtbl(RoleXml)
      SELECT Y.ID.value('./RoleXml[1]', 'XML') 
      FROM @UserDetailsXML.nodes('UserDetails/UserDetailsRow') AS Y(ID) 
  </code></pre>