Monthly Archives: July 2007

SQLCMD and Output to an XML file issue

/* Start sql cmd and type the following command: */ SELECT ( SELECT DepartmentID AS "DepartmentID",Name AS "DepartmentName", GroupName AS "GroupName" FROM HumanResources.Department FOR XML PATH(‘Department’),TYPE) FOR XML PATH(‘Departments’),ROOT(‘Organizations’) GO /* The output becomes byte stream. Based on BOL, we … Continue reading

Posted in XML, XQuery and XPath | 1 Comment