首页 > 代码库 > sql4
sql4
USE [MainDb]GO/****** Object: StoredProcedure [dbo].[BackDataUpdate] Script Date: 07/15/2014 08:46:25 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCreate PROCEDURE [dbo].[ProcChatOnlineByAddDateStatisticSelect]( @sDate VARCHAR(10), @eDate VARCHAR(10) )ASBEGIN 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 CATCHCOMMIT TRANRETURN 1ERR:BEGIN ROLLBACK TRAN RETURN 0ENDGO
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。