close

/****** program******/

USE [OOODB]
GO
/****** Object:  UserDefinedFunction [dbo].[fnRTA016_sumOfOvertime03]    Script Date: 2022/8/4 上午 11:35:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:        <Hugo Chang>
-- Create date: <2022-08-03>
-- Description:    <get sum of overtime>
-- =============================================
ALTER FUNCTION [dbo].[fnRTA016_sumOfOvertime03]
(
    -- Add the parameters for the function here
    @p1 int,
    @p2 int,
    @p3 nvarchar(100)
)
RETURNS  @__tb TABLE
 (
  調整後平日加班時數a INTEGER
 )
AS
BEGIN

    INSERT INTO @__tb 
    SELECT 調整後平日加班時數a FROM 
     OPENROWSET(
       'MSDASQL',
       'DRIVER={SQL Server}; SERVER=localhost; Trusted_Connection=yes', 
       'EXEC OOODB.[dbo].[RTA016_V5112_MODIFIED5]@ATMY =2021,@ATM =12,@EMPNOA =YC0023,@CTIMEB =NULL,@CTIMEE=NULL,@FavDisplayOpt=optMonth'
     );

  RETURN;
END

 

/****** program******/

select * from [dbo].fnRTA016_sumOfOvertime03(1,1,'')

 

arrow
arrow
    創作者介紹
    創作者 M先生 的頭像
    M先生

    雨果

    M先生 發表在 痞客邦 留言(0) 人氣()