SQL Server 没有类似于Oracle START WITH NAME='xx' CONNECT BY PRIOR ID=PARENT_ID这样的语句,但是可以通过自定义标准函数+With语句实现,速度也是杠杠的 ALTER FUNCTION [dbo].[RecursionSysLocation] ( -- Add the parameters for the function here ) ) RETURNS TABLE AS RETURN ( with temp ( [Id], [p…