注銷

          注銷

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            112 隨筆 :: 7 文章 :: 18 評論 :: 0 Trackbacks

          /*
          ?exec IbComAddress_Select 1,8,1,1
          */

          SET QUOTED_IDENTIFIER OFF
          GO
          SET ANSI_NULLS OFF
          GO

          ALTER? PROCEDURE IbComAddress_Select??

          ? @CreatedUserID int,
          ? @pagesize int,
          ? @pageindex int,
          ? @docount int

          ? AS
          ?? set nocount on
          ?? declare @strSql varchar(3000)
          ?? if(@docount=1)
          ??? begin
          ????
          ?????? set @strSql='Select count(*) from '
          ?????????????????? +'(select?? CustomerName , phone,'' HomePhone,'' Mobile from? CustomerInfomation? where? CreatedUserID='+cast(@CreatedUserID as varchar(50))+
          ???????????????????????? ' union all? select [Name],JobPhone,HomePhone,Mobile from? CustomerContactor? where? CreatedUserID='+cast(@CreatedUserID as varchar(50))+')a'

          ? print @strSql???
          ?--exec(@strSql)????

          ??? end
          ? else
          ???? begin
          ???????? declare @indextable table(id int identity(1,1),nid int,CustomerName varchar(50),phone varchar(50),HomePhone varchar(50),Mobile varchar(50))--聲明臨時表
          ???????? declare @PageLowerBound int
          ???????? declare @PageUpperBound int
          ???????? set @PageLowerBound=(@pageindex-1)*@pagesize
          ???????? set @PageUpperBound=@PageLowerBound+@pagesize
          ???????? set rowcount @PageUpperBound
          ???????
          ???????? insert into @indextable(nid,CustomerName,phone,HomePhone,Mobile)
          ????????

          ???????? select CustomerID,? CustomerName , phone,'' HomePhone,'' Mobile from? CustomerInfomation? where? CreatedUserID=@CreatedUserID?
          ???????? union all
          ???????? select CustomerID, [Name],JobPhone,HomePhone,Mobile from? CustomerContactor? where? CreatedUserID=@CreatedUserID
          ????????
          ???????? select * from @indextable t where t.id>@PageLowerBound and t.id <=@PageUpperBound order by t.id
          ????? end
          ??


          GO
          SET QUOTED_IDENTIFIER OFF
          GO
          SET ANSI_NULLS ON
          GO

          ?

          posted on 2006-12-06 11:31 注銷..... 閱讀(150) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 嵊泗县| 宜川县| 福建省| 澳门| 裕民县| 垫江县| 阜康市| 永嘉县| 诏安县| 怀宁县| 教育| 宜宾市| 郁南县| 根河市| 三河市| 伊宁市| 莱西市| 黔南| 长武县| 莱芜市| 大邑县| 乡宁县| 尤溪县| 丹凤县| 逊克县| 墨玉县| 务川| 广丰县| 福泉市| 太和县| 玉林市| 海淀区| 浑源县| 惠水县| 金堂县| 凤凰县| 郸城县| 浦城县| 安新县| 喀什市| 江川县|