SQL2008 查询XML
SELECT 1 as Tag,
NULL as Parent,
id as[area!1!ID!xml],
name as [area!1!Name!xml],
pid as [area!1!PID!xml],
zipcode as [area!1!zipcode!xml]
FROM area
FOR XML EXPLICIT,root('Areas')
结果:
SELECT 1 as Tag,
NULL as Parent,
id as[area!1!ID!xml],
name as [area!1!Name!xml],
pid as [area!1!PID!xml],
zipcode as [area!1!zipcode!xml]
FROM area
FOR XML EXPLICIT,root('Areas')
结果: