<P>有这样的一个存储过程</P> <P>CREATE PROCEDURE SelectProblem <BR>@n int,<BR>@sectionID int<BR>AS<BR>declare @i int<BR>set @i=0<BR>while @i<@n<BR>begin<BR>insert into PaperDetail (TitleID) values ('exec('select top '+cast(@n as varchar)+' [ID] from problem where sectionid='+cast(@sectionID as varchar)+' order by newid()')')<BR>set @i=@i+1<BR>end<BR>GO</P> <P>在inset(TitleID) 是取不到 那个随机产生的 [ID] 就是插不进去 ,这该怎么办拉</P> <P>恳请广大博友解答一下,小弟不胜感激!</P> <P> </P>
慕婉清6462132
相关分类