title: Why do I get error "illegal qualified name character" when trying to INSERT
body: <p>Can someone help me get the following INSERT Statement working. 
  I always get the following error when executing the below code:</p>
  
  <blockquote>
    <p>Msg 9455, Level 16, State 1, Line 3
    XML parsing: line 1, character 18, illegal qualified name character</p>
  </blockquote>
  
  <p>Thanks so much in advance!</p>
  
  <pre><code>--CREATE DATABASE TestDB;
  --GO 
  
  USE TestDB;
  GO
  
  
  IF OBJECT_ID ('AllDataTypes','U') IS NOT NULL
      DROP TABLE AllDataTypes;
  GO
  
  
  CREATE TABLE AllDataTypes
  ( 
      --Character data types
      [char] char(3),
      [varchar] varchar(10),
      [varcharMAX] varchar(MAX),
      [text] text,
  
      --Unicode character data types
      [nchar] nchar(3),
      [nvarchar] nvarchar(10),
      [nvarcharMAX] nvarchar(MAX),
      [ntext] ntext,
  
      --Binary data types
      [bit] bit,
      [binary] binary(3),
      [varbinary] varbinary(10),
      [varbinaryMAX] varbinary(MAX),
      [image] image,
  
  
      --Numeric data types (exact)
      [tinyint] tinyint,
      [smallint] smallint,
      [int] int,
      [bigint] bigint,
      [decimal] decimal(14,6),
      [numeric] numeric(14,6),
      [smallmoney] smallmoney,
      [money] money,
  
  --Numeric data types (approx.)
      [float] float,
      [real] real,
  
  
       --Date data types
      [datetime] datetime,
      [datetime2] datetime2,
      [smalldatetime] smalldatetime,
      [date] date,
      [time] time,
      [datetimeoffset] datetimeoffset,
      [timestamp] timestamp,
  
   --Special data types
      [sql_variant] sql_variant,
          [uniqueidentifier] uniqueidentifier,
      [xml] xml,
      [hierarchyid] hierarchyid,
  
       --Spatial data types
      [geometry] geometry,
      [geography] geography  
  
  );
  GO
  
  
  INSERT INTO [AllDataTypes]
  (
           [char]
         ,[varchar]
         ,[varcharMAX]
         ,[text]
         ,[nchar]
         ,[nvarchar]
         ,[nvarcharMAX]
         ,[ntext]
         ,[bit]
         ,[binary]
         ,[varbinary]
         ,[varbinaryMAX]
         ,[image]
         ,[tinyint]
         ,[smallint]
         ,[int]
         ,[bigint]
         ,[decimal]
         ,[numeric]
         ,[smallmoney]
         ,[money]
         ,[float]
         ,[real]
         ,[datetime]
         ,[datetime2]
         ,[smalldatetime]
         ,[date]
         ,[time]
         ,[datetimeoffset]
         ,[sql_variant]
         ,[uniqueidentifier]
         ,[xml]
         ,[hierarchyid]
         ,[geometry]
         ,[geography])
   VALUES
  (
           -- Character data
            'ABC'              --  &lt;char, char(3),&gt;
             ,'Varying'            -- ,&lt;varchar, varchar(10),&gt;
             ,'MAX of over 1 billion chars (varying)'-- ,&lt;varcharMAX, varchar(max),&gt;
             ,'Up to 2 GB of data!'    -- ,&lt;text, text,&gt;
  
           --Unicode character data
             ,N'Úni'               -- ,&lt;nchar, nchar(3),&gt;
             ,N'Únicode'           -- ,&lt;nvarchar, nvarchar(10),&gt;
             ,N'Pési fór á Þingvallaheiði' -- ,&lt;nvarcharMAX, nvarchar(max),&gt;
             ,N'Íslenska - ÓÍÁÚÞÐÐÆÖ'  -- ,&lt;ntext, ntext,&gt;
  
           --Binary data
           ,0-- ,&lt;bit, bit,&gt;
             ,CAST('ABC' as binary(3))-- ,&lt;binary, binary(3),&gt;
             ,CAST('Varying' as varbinary(10))-- ,&lt;varbinary, varbinary(10),&gt;
             ,CAST('MAX of 2 GB binary data (varying)' as varbinary(MAX)) -- ,&lt;varbinaryMAX,     varbinary(MAX),&gt; 
             ,(select * from OPENROWSET(BULK 'C:\Users\adminstrator\Documents\SQL Server     Management Studio\image.jpg', SINGLE_BLOB) i) -- ,&lt;image, image,&gt;
  
           --Numeric data (exact)
             ,255              -- ,&lt;tinyint, tinyint,&gt;
             ,32767                -- ,&lt;smallint, smallint,&gt;
             ,2147483647           -- ,&lt;int, int,&gt;
             ,9223372036854775807  -- ,&lt;bigint, bigint,&gt;
             ,99999999.999999      -- ,&lt;decimal, decimal(14,6),&gt;
             ,99999999.999999      -- ,&lt;numeric, numeric(14,6),&gt;
             ,214748.3647          -- ,&lt;smallmoney, smallmoney,&gt;
             ,922337203685477.5807     -- ,&lt;money, money,&gt;
  
           --Numeric data (approx.)
             ,1.79E+308            -- ,&lt;float, float,&gt;
           ,3.40E+38           -- ,&lt;real, real,&gt;
  
           --DateTime data
           ,GETDATE()                       -- ,&lt;datetime, datetime,&gt;
             ,SYSDATETIME()                         -- ,&lt;datetime2, datetime2(7),&gt;
             ,CAST(GETDATE() as smalldatetime)          -- ,&lt;smalldatetime, smalldatetime,&gt;
             ,CAST(GETDATE() as date)           -- ,&lt;date, date,&gt;
             ,CONVERT(varchar(12), GETDATE(), 14)   -- ,&lt;time, time(7),&gt;
             ,TODATETIMEOFFSET(GETDATE(), '-05:00')     -- ,&lt;datetimeoffset, datetimeoffset(7),&gt;
  
  
           --Special data
             ,GETDATE()                         -- ,&lt;sql_variant, sql_variant,&gt;
           ,NEWID()                             -- ,&lt;uniqueidentifier, uniqueidentifier,&gt;
             ,'&lt;XMLRoot&gt;-- ,&lt;xml, xml,&gt;
               &lt;Person&gt;
                  &lt;FirstName&gt;Heimir&lt;/FirstName&gt;
                  &lt;LastName&gt;Jonsson&lt;/LastName&gt;
               &lt;/Person&gt;
            &lt;/XMLRoot&gt;'                         
             ,null                              -- ,&lt;hierarchyid, hierarchyid,&gt;
  
           --Spatial data
             ,geometry::STGeomFromText('LINESTRING (100 100, 20 180, 180 180)', 0)    -- ,    &lt;geometry, geometry,&gt;
             ,geography::STMPolyFromText('MULTIPOLYGON(((-122.358 47.653, -122.348 47.649,     -122.358 47.658, -122.358 47.653)), ((-122.341 47.656, -122.341 47.661, -122.351 47.661, -122.341     47.656)))', 4326)       -- ,&lt;geography, geography,&gt;
  );
  GO
  
  
  SELECT 
      * 
  FROM [AllDataTypes] ;
  GO
  </code></pre>