sql4

USE [MainDb]
GO

/****** Object:  StoredProcedure [dbo].[BackDataUpdate]    Script Date: 07/15/2014 08:46:25 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

Create PROCEDURE [dbo].[ProcChatOnlineByAddDateStatisticSelect]
(
    @sDate VARCHAR(10),
    @eDate VARCHAR(10) 
)
AS
BEGIN TRAN
    DECLARE @ID AS INT
    BEGIN TRY
        SET @ID=0
        SELECT TOP 1 @ID=ID FROM backdata WITH(NOLOCK) WHERE
            ManagerID=@ManagerID AND CountDate=YEAR(GETDATE())*10000+MONTH(GETDATE())*100+DAY(GETDATE())
        IF @ID=0
            INSERT INTO backdata(ManagerID,CountDate) VALUES(
                @ManagerID,YEAR(GETDATE())*10000+MONTH(GETDATE())*100+DAY(GETDATE())
            )
        
        IF @Pass=1    
            UPDATE backdata SET resume_pass=resume_pass + 1 WHERE
                ManagerID=@ManagerID AND CountDate=YEAR(GETDATE())*10000+MONTH(GETDATE())*100+DAY(GETDATE())
        IF @Pass=10
            UPDATE backdata SET resume_nopass=resume_nopass + 1 WHERE
                ManagerID=@ManagerID AND CountDate=YEAR(GETDATE())*10000+MONTH(GETDATE())*100+DAY(GETDATE())
    END TRY
    BEGIN CATCH
        GOTO ERR
    END CATCH
COMMIT TRAN
RETURN 1
ERR:
BEGIN
    ROLLBACK TRAN
    RETURN 0
END





GO

 

sql4,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。