FOR XML AUTO and column name with space issue in SQL Server 2005
问题 Here is my SQL select ID as [Emp ID], Name as [Employee name], Sal as [Salary] from Emp FOR XML AUTO, ELEMENTS, ROOT('customers') When I issue this SQL then unknown data is added in xml with my field name. I got the xml like <customers> <Emp> <Emp_x0020_ID>1</Emp_x0020_ID> <Employee_x0020_name>bob</Employee_x0020_name> <Salary>2020</Salary> </Emp> <Emp> <Emp_x0020_ID>2</Emp_x0020_ID> <Employee_x0020_name>keith</Employee_x0020_name> <Salary>6500</Salary> </Emp> <Emp> <Emp_x0020_ID>3</Emp_x0020