标签:http io ar color 使用 sp 数据 on div
1
2
3
4
5
6
7
|
[sql] with organise as ( select * from OrganiseUnit where OrganiseUnit.OrganiseUnitID = @OrganiseUnitID union all select OrganiseUnit.* from organise, OrganiseUnit where organise.OrganiseUnitID = OrganiseUnit.ParentOrganiseUnitID) select OrganiseName from organise |
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[sql] create function SplitIn(@c varchar (2000),@split varchar (2)) returns @t table (col varchar (20)) as begin while(charindex(@split,@c)<>0) begin insert @t(col) values ( substring (@c,1,charindex(@split,@c)-1)) set @c = stuff(@c,1,charindex(@split,@c), ‘‘ ) end insert @t(col) values (@c) return end |
1
|
select * from OrganiseUnit where OrganiseCode in ( select col from SplitIn(@OrganiseCode, ‘,‘ )) |
标签:http io ar color 使用 sp 数据 on div
原文地址:http://www.cnblogs.com/volare/p/4115324.html