Hello everyone. I just am a beginner and am learning XML maipulation. Now i tried this and it doesn't work for me. I can't figure out what the error is. The error it shows is



The XML parse error 0xc00ce505 occurred on line number 4, near the XML text "        Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocument, Line 1
The error description is 'A name contained an invalid character.'.
Msg 208, Level 16, State 1, Line 23
Invalid object name 'CustomerDetails'.



Here's the statements that i have written.


create database Abhishek
use Abhishek

DECLARE @Doc int
DECLARE @XMLDoc nvarchar (100)
SET @XMLDoc = N'

    
        
            
            
        

    


    
        
            
        

    

'

exec sp_xml_preparedocument @Doc OUTPUT, @XMLDoc

INSERT INTO CustomerDetails
SELECT * FROM openxml(@Doc,'/ROOT/Customer',1) WITH (CustomerID varchar(10), ContactName varchar(20))


I'd really appreciate your help :)


EDIT  : OMG i caught my fault ! I declared the DECLARE @XMLDoc nvarchar (100) toooooooo small !!! lmao