首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

函数返回table?解决方法

2012-01-26 
函数返回table?--函数的建立是正确的if(object_id( test )isnotnull)dropfunctiontestgocreatefunctiontes

函数返回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()

热点排行