代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。