SQL Prefix issue N with variable

前端 未结 2 940
囚心锁ツ
囚心锁ツ 2021-01-28 14:21
DECLARE @XML_VC_8 XML;
DECLARE @string NVARCHAR(MAX);
DECLARE @PreFix NVACHAR(MAX);

SET @PreFix =\'N\' 
SET @XML_VC_8 = \'

        
相关标签:
2条回答
  • 2021-01-28 14:54

    removing the N variable and changing encoding to utf-16, this should get your characters

    Declare @XML_VC_8 XML;
    Declare @string nvarchar(max);
    
    
    set @XML_VC_8 = N'<?xml version="1.0" encoding="utf-16"?><test>fdff مرحبا</test>';
    set @string=Convert(nvarchar(max),@XML_VC_8);
    print @string
    
    0 讨论(0)
  • 2021-01-28 15:04

    These work fine!

    DECLARE @XML_VC_8 XML;
    SET @XML_VC_8 = N'<?xml version="1.0" encoding="utf-16"?><test>fdff مرحبا</test>';
    SELECT @XML_VC_8
    

    0 讨论(0)
提交回复
热议问题