Hello I'm trying to insert some XML data into a table on SQL Server 2008. However I keep getting thrown this error;
XML parsing: line 1, character 39, unable to switch the encoding
The database column filemeta uses the XML datatype, and I've switch the encoding to UTF-16 which I believe is necessary for adding XML data.
INSERT INTO testfiles
(filename, filemeta)
VALUES
('test.mp3', '<?xml version="1.0" encoding="utf-16" standalone="yes"?><!--This is a test XML file--><filemeta filetype="Audio"><Comments /><AlbumTitle /><TrackNumber /><ArtistName /><Year /><Genre /><TrackTitle /></filemeta>');
Help, I'm stuck.
NB: I created the XML with XMLTextWriter.