SQL Server????·??????????
???????????? ???????[ 2013/4/25 10:58:46 ] ????????
??????2???????????1??????????????????????????????????"p"????"j"????????????????????????е????4??
?4
????????
?????????????????????SQL Server?У????????????????????????????2?????????"P"??"J"???????????????????
???????????б?RelactionGraph??create& Insert?????????
use TestDB
go
if object_id('RelactionGraph') Is not null drop table RelactionGraph
create table RelactionGraph(ID int identity??Item nvarchar(50)??RelactionItemnvarchar(20)??constraint PK_RelactionGraph primary key(ID))
go
create nonclustered index IX_RelactionGraph_Item on RelactionGraph(Item)include(RelactionItem)
create nonclustered index IX_RelactionGraph_RelactionItem on RelactionGraph(RelactionItem)include(Item)
go
insert into RelactionGraph (Item?? RelactionItem ) values
('a'??'b')??('a'??'c')??('a'??'d')??('a'??'e')??
('b'??'f')??('b'??'g')??('b'??'h')??
('c'??'i')??('c'??'j')??
('f'??'k')??('f'??'l')??
('k'??'o')??('k'??'p')??
('o'??'i')??('o'??'l')
go
??????д????洢????up_GetPath
use TestDB
go
exec dbo.up_GetPath
@Node = 'p'??
@RelatedNode = 'j'
go
?????????洢????????????????????1????????????????????2?????????ι????????????е?1??????????????????2?????@Node ?? @RelatedNode ???????????????????????????????????????????#1??#2?????ж??????#1??#2????г????е???????????????????·??????????????????????????????????????????????????????@MaxLevel smallint=100????????е?????100??????????е?????????????????????????????@MaxLevel????????????????????????????????????????????????????????????????????л?????????????????????????????Node ?? RelatedNode????????????????????????????????????á?
??????????洢???????У?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11