Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
SELECT
emp.Name ,
emp.Salary + emp.extras as Total
FROM dbo.Employee emp
FOR XML AUTO,TYPE, ELEMENTS ,ROOT('Salaries')
--result will apeare in SQL server management studio
--to export it to physical drive you must put this query in BCP like this
--put this query to BCP and replace "localhost" with your server name and replace path or file name
BCP "SELECT
emp.Name ,
emp.Salary + emp.extras as Total
FROM dbo.Employee emp
FOR XML AUTO,TYPE, ELEMENTS ,ROOT('Salaries')"
QUERYOUT "C:\Salaries.XML" -c -t -T -S localhost -- your path and your server name