注销

注销

  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 注销..... 阅读(140) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: