bcp queryout xml format file encoding utf-8 xml file validation fail
问题 I have to generate xml file for the format of encoding="UTF-8. I used bcp queryout. xml file was generating. But my issue was the xml file validation fail. could any one help me to resolve this? This is my code. DECLARE @xmlBody AS VARCHAR(MAX)= '<?xml version="1.0" encoding="UTF-8"?>'+ CAST(@xmlStr AS VARCHAR(MAX)) INSERT INTO [dbo].[MasterXml] ([PurchaseOrderID] ,[Code]) values (@PurchaseOrderID, @xmlBody) Declare @command varchar(8000) SET @command= 'bcp "SELECT TOP 1 [Code] from [tec_Dev]