自定义函数模板
---- 标量值函数: dbo.--
if exists (select * from dbo.sysobjects
where id = object_id(N'dbo.') and OBJECTPROPERTY(id, N'IsScalarFunction') = 1)
Drop Function dbo.
GO
Create Function dbo.
(
@
)
Returns int/Char()/Varchar()
AS
Begin
Declare @val int/Char()/Varchar()
Select @val =
Return @val
End
GO
---- 表值函数: dbo.--
if exists (select * from dbo.sysobjects
where id = object_id(N'dbo.') and OBJECTPROPERTY(id, N'IsTableFunction') = 1)
Drop Function dbo.
GO
Create Function dbo.
(
@
)
Returns Table
AS
Begin
Return (Select * From )
End
GO

浙公网安备 33010602011771号