select O.id,O.phone from Messge O//这句是查找Message表中的id和phone字段.
inner join @indextable t on O.orderid=t.nid//再加上这句算什么?

解决方案 »

  1.   

    表示和表@indextable 相关联,Messge 表中的orderid=@indextable 表中的nid字段
    你看看@indextable 表是什么内容
      

  2.   

    两表通过orderid=nid关联.匹配的才显示数据.如message
    id , phone 
    1    1
    2    1@indextable
    nid
    1那么只有ID=1的才显示出来,而id=2的不显示.
      

  3.   

    CREATE procedure P_GetPagedOrders2000 
    (@startIndex int,
    @endIndex int
    )
    as
    set nocount on
    declare @indextable table(id int identity(1,1),nid int,phone VarChar)
    set rowcount @endIndex
    insert into @indextable(nid,phone) select id,phone from Message order by id descselect O.id,O.phone from Message O inner join @indextable t on O.id=t.nid
    where t.id between @startIndex and @endIndex order by t.id
    set nocount off
    RETURN
    GO那麻烦帮我看下这一段存储过程..
    运行的时候出现
    将截断字符串或二进制数据。
    语句已终止。 不知道怎么回事
      

  4.   

     @indextable 表phone字段设varchar (1000)