PB 通过存储程序实现得到两个日期之前的差的秒


IF EXISTS (SELECT name FROM sysobjects
         WHERE name = 'au_info' AND type = 'P')
   DROP PROCEDURE au_info
GO

GO
CREATE PROCEDURE au_info
   @startdate datetime,
   @enddate datetime,
   @rettime varchar(8000) output
AS
set @rettime =DATEDIFF ( second ,@startdate, @enddate)

select @rettime

GO

DECLARE @rettime varchar(8000)
EXECUTE au_info @startdate = '2007-07-6 19:00:00', @enddate = '2007-07-6 19:45:11',@rettime= ''


declare datediff procedure for au_info
 @startdate = :ls_begin,
 @enddate = :ls_end,
 @rettime = '' output using sqlca;
execute datediff;
fetch datediff into:ls_diff;
close datediff;

你可能感兴趣的:(PB 通过存储程序实现得到两个日期之前的差的秒)