create function fun_A()   #标题函数、create function fun_name() returns output_type as begin return value end;
returns int
as
begin
return 1;
end
go

create function fun_B() #多语句用户定义函数、create function fun_name() returns @value table(colum_list) as begin return ; end 
returns @tb table(ID int ,Name nvarchar(8))
as
begin
insert into @tb(ID,Name) values(1,'111'),(2,'222');
return;
end
go


create function fun_C() #内联用户定义函数、create function fun_name() returns table as return select......;
returns table
as
return select 1 as A,2 as B,3 as C;
go

相关文章:

  • 2021-11-20
  • 2021-06-06
  • 2021-09-09
  • 2021-12-12
  • 2022-03-02
  • 2021-11-13
  • 2021-07-11
猜你喜欢
  • 2022-02-08
  • 2021-11-23
  • 2022-02-23
  • 2022-12-23
相关资源
相似解决方案