XML Parsing - Unable to switch the encoding - SQL Parameter

  • I pass an XML parameter from a C# program.

    This seems to work fine if i change the encoding from utf-16 to utf-8.

    Why does the XML parser fail with utf-16 as the default encoding?

    I know I can use the N' :

    SET @XMLContent = N'<?xml version="1.0" encoding="utf-16"?><...'

    And then it works fine.

    But I don't set the XML content in SQL, I set it in my C# program.

    Is there a way to convert it to Unicode in the stored procedure?

    Thank you.

  • Corrected it in the c# program before calling the stored proc.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply