标签:style blog color 2014 div line
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
标签:style blog color 2014 div line
原文地址:http://www.cnblogs.com/ustcyc/p/3843947.html