sql自定義函數定義和調用方法如下:
CREATE function mingchen
(
@aa varchar(150) --參數
)
returns @fn_table table
(
ID int identity(1,1) not null,
cc varchar(150)
)
as
begin
insert into @fn_table select .......---省略
return
end
調用select * from mingchen('123')