title: Sql Server 2005 Xml data type has CDATA removed on INSERT
body: <p>I have the following table in my database:</p>
  
  <pre><code>CREATE TABLE [dbo].[XmlData](
      [id] [int] IDENTITY(1,1) NOT NULL,
      [xmldata] [xml] NOT NULL,
  CONSTRAINT [PK_XmlData] PRIMARY KEY CLUSTERED 
  (
      [id] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF,
  ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  </code></pre>
  
  <p>And when I run the following INSERT and SELECT statements I can see that my CDATA sections are being stripped somewhere along the line. </p>
  
  <pre><code>INSERT 
      INTO 
          [XmlCdataTest].[dbo].[XmlData] ([xmldata])
      VALUES
          ('&lt;doc&gt;&lt;control&gt;&lt;value&gt;&lt;![CDATA[10 &lt; 11]]&gt;&lt;/value&gt;&lt;/control&gt;&lt;/doc&gt;')
  GO
  
  SELECT [xmldata] FROM XmlData
  GO
  </code></pre>
  
  <p>Is this some sort of bug in SQL 2005 or is there some option I can use to tell SQL Server to not strip these cdata sections from my xml data?</p>