日期:2014-05-18  浏览次数:20510 次

函数返回table?
--函数的建立是正确的
if(object_id( 'test ')is   not   null)
drop   function   test
go
create   function   test()
returns   @t   table(A1   varchar(20),A2   varchar(20),A3   varchar(1000))
as
begin
insert   into   @t
select   A1,A2,A3   from   A  
return
end
go

--这句调用不对,报错
select   dbo.test()   --from   A   where   A1= 'c '
请问如何调用返回table的函数呢?

------解决方案--------------------
select * from dbo.test()
------解决方案--------------------
select * from dbo.test()