1 Star 0 Fork 0

Liubaohua / wlgproc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DP_WLG_GetCustInfo.txt 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
Liubaohua 提交于 2015-07-20 11:35 . initial submission
USE [UFDATA_002_2013]
GO
/****** Object: StoredProcedure [dbo].[DP_WLG_GetCustInfo] Script Date: 07/15/2015 11:19:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[DP_WLG_GetCustInfo]
@CursorCount int output
AS
BEGIN
SET NOCOUNT ON;
declare @cnt int -- get total count
select @cnt = count(1) from Customer
SELECT cCusCode AS CustomerId,cCusName AS CustomerName,cCusPhone AS CustomerTel,
cCusPerson AS ContactName--,CustomerDebt,TotalCredit,RemainCredit
from
(
SELECT ROW_NUMBER() OVER(ORDER BY a.cCusCode) AS rn,
a.cCusCode ,
cCusName ,
cCusPhone ,
cCusPerson ,b.farsum+b.fDLSum as CustomerDebt,iCusCreLine as TotalCredit,
iCusCreLine-b.farsum-b.fDLSum as RemainCredit
--,bCredit ,b.farsum
FROM Customer a left join SA_CreditSum b
on a.cCusCode = b.cCusCode
where b.iType = 1
) t where rn>=@CursorCount and rn<@CursorCount+100
if @CursorCount+100>@cnt or @cnt=0
set @CursorCount = 0
else
set @CursorCount = @CursorCount+99
END
GO
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chinablue2017/wlgproc.git
git@gitee.com:chinablue2017/wlgproc.git
chinablue2017
wlgproc
wlgproc
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891