初学SQL SERVER函数 不知怎么测试函数返回结果?SOS!!!
afeiod
2009-12-15
create function getAllParentGroupNameByGroupId(@originId varchar(50))
--returns @t table(id varchar(50)) returns varchar(500) as begin declare @t table(id varchar(50)) declare @tempParentId varchar(50) declare @parent varchar(500) declare groupName_cur cursor for select name from topoGroupTable where originId not in(select originId from @t) declare @temp_name varchar(50) insert @t select a.parentId from topoTreeNodeTable as a where a.originId = @originId while @@rowcount>0 begin insert @t select a.parentId from topoTreeNodeTable a inner join @t as b on b.id=a.originId and a.parentId not in(select id from @t) and a.parentId not in( '','TVNode=2','TVNode=7') end --select @parent=g.name from @t t,TopoGroupTable g where t.id=g.originId open groupName_cur fetch next from groupName_cur into @temp_name while @@fetch_status=0 begin select @parent=@parent+'_'+@temp_name --print 'name--->'+@parent fetch next from groupName_cur into @temp_name end close groupName_cur deallocate groupName_cur return @parent end[/size][size=x-small][size=medium][/size] print( getAllParentGroupNameByGroupId 'Server=100001,TVNode=105') |
|
afeiod
2009-12-15
就是想打印 函数返回值的打印结果
|
|
afeiod
2009-12-17
who known? NOBODY?
|
|
liutao刘涛1990
2011-01-19
你可以将你定义好的变量,并且是你想要测试的那个变量。加在select后面。再return就可以看到结果了。
|
相关讨论
相关资源推荐
- appengine-java-sdk
- eclipse+myeclipse基于Google App Engine SDK开发
- scala lift_Lift 2.0,Scala 2.8.0 RC7和GWT和App Engine SDK的Google更新
- Google App Engine技术架构资料大盘点
- 探索Google App Engine背后的奥秘(3)- Google App Engine的简介
- 安装Google App Engine for Java开发工具集
- GWT 项目开发 1.6.4 本地开发 appengine-tools-api 突破限制
- 如何开发你的第一个java google app engine 程序
- 探索Google App Engine背后的奥秘(3)- Google App Engine的简介(转载)
- GWT、Google APP Engine初试