USE [PLAYBAR_PERSONAL]
GO
/****** 對象: StoredProcedure [dbo].[CP_select_All_Customer] 腳本日期: 03/10/2009 21:09:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: sufei
-- Create date: <2009-2-16,,>
-- Description: <查詢所有的用戶信息
---Table (手機號,用戶名,用戶信箱,用戶年齡,性別,用戶職業,興趣愛好,現居地,用戶積分,註冊時間 ,備註)
-- =============================================
ALTER PROCEDURE [dbo].[CP_select_All_Customer]
@startindex int ,
@pagesize int
AS
BEGIN
with NewCustomer as (
select row_number()over (order by Cus_Id)as rownumber, Cus_MSISDN,Cus_Name,Cus_Email,Cus_Age,Cus_Sex,Cus_Job,Cus_Intrestings,Cus_Address,Cus_Value,Cus_RegTime,Cus_Remark,Cus_State
from Customer
where Isdelete=0
)
select rownumber, Cus_MSISDN,Cus_Name,Cus_Email,Cus_Age,Cus_Sex,Cus_Job,Cus_Intrestings,Cus_Address,Cus_Value,Cus_RegTime,Cus_Remark,Cus_State
from NewCustomer
where rownumber >=(@startindex-1)*@pagesize+1 and rownumber<=(@startindex-1)*@pagesize+(@pagesize)
select count(*) from Customer where Isdelete=0
END