Hierarchy in SQL server 2005 with XML
问题 I wonder is there anyway to select hierarchy in SQL server 2005 and return xml format? I have a database with a lot of data (about 2000 to 3000 records), and i am now using a function in SQL server 2005 to retrieve the data in hierarchy and return an XML but it seems not perfect because it's too slow when there is a lot of data Here is my function Database ID Name Parent Order Function CREATE FUNCTION [dbo].[GetXMLTree] ( @PARENT bigint ) RETURNS XML AS BEGIN RETURN /* value */ (SELECT [ID]