if exists (
select *
from dbo.sysobjects
where id = object_id(N
'[dbo].[FunName]')
and xtype
in (N
'FN', N
'IF', N
'TF'))
drop function [dbo].[FunName] GO
SET QUOTED_IDENTIFIER
ON GO
SET ANSI_NULLS
ON GO ----函数 : FunName ----主要功能:返回一个数据集(
Table)。 ----运行实例:
select *
from dbo.FunName(2)
CREATE FUNCTION FunName ( 参数列表)
RETURNS @表变量名
table (字段列表 )
AS BEGIN INSERT INTO @表变量名
SELECT *
from TableName
RETURNEND GO
SET QUOTED_IDENTIFIER
OFF GO
SET ANSI_NULLS
ON GO
转载请注明原文地址: https://www.6miu.com/read-63637.html