自定义函数模板

自定义函数模板

---- 标量值函数:  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

posted @ 2008-07-08 09:33  fujing0088  阅读(136)  评论(0)    收藏  举报