Sql server 在侧存储过程中调用用户定义函数的方法有哪些?

Sql server 在侧存储过程中调用用户定义函数的方法有哪些?,sql-server,tsql,Sql Server,Tsql,使用select语句我们可以调用存储过程中的函数,是否有其他方法调用存储过程中的函数。试试看 设置@yourvariable=yourfunctionname'YourParams' getdate您可以在进程内调用 -- ================================================ -- Template generated from Template Explorer using: -- Create Procedure (New Menu).SQL --

使用select语句我们可以调用存储过程中的函数,是否有其他方法调用存储过程中的函数。

试试看

设置@yourvariable=yourfunctionname'YourParams'

getdate您可以在进程内调用

-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE Proc1

AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    -- Insert statements for procedure here
    declare @date datetime

   set @date= getdate()
END
GO

我们可以使用select语句调用函数,但是我想知道除了使用select语句之外调用函数的其他方法。答案是经过编辑的。如果您正在寻找其他方法,请告诉我只有这两种方法调用函数吗?函数表值或标量值可以在存储过程中以与批处理语句中完全相同的方式调用;没有限制。也许你可以考虑在你的问题中提供更多的细节来说明你到底想知道什么。