注銷

          注銷

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            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)  編輯  收藏

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 邵阳县| 永善县| 汨罗市| 万州区| 东城区| 文成县| 阿图什市| 昔阳县| 武川县| 宁晋县| 平武县| 浮梁县| 紫阳县| 桂林市| 泗水县| 乡宁县| 临澧县| 焉耆| 霍城县| 莱芜市| 洛隆县| 丰城市| 柞水县| 宁城县| 新巴尔虎左旗| 永平县| 股票| 涿州市| 满洲里市| 苏尼特右旗| 开封市| 临武县| 林州市| 乐昌市| 漯河市| 安溪县| 黔西| 宝鸡市| 石门县| 定远县| 东城区|