写了一个存储过程如下:
CREATE PROCEDURE dbo.getPauseDays
@htongInfoIdx int
AS
declare @p1 binary(16)
declare @p2 binary(16)
create table #(c1 text)
insert # select ""
SELECT @p1 = textptr(c1) FROM #
--声明一个游标
DECLARE tb CURSOR LOCAL
FOR
SELECT textptr( pausedays)
FROM hetongpauseinfo where uidx = @htongInfoIdx
OPEN tb
FETCH tb INTO @p2
WHILE @@fetch_status=0
BEGIN
UPDATETEXT #.c1 @p1 NULL null hetongpauseinfo.pausedays @p2
FETCH tb INTO @p2
END
CLOSE tb
DEALLOCATE tb
select c1 from #
drop table #
GO
在查询分析器中 exec getPauseDays 12 可以的到查询的集,但是放在select 语句中怎么也不行了..select a.* from (getPauseDays 12) as a 形如这样的读取是不行的吗