这样改:
ALTER proc Getauthors
@StartRow as int = null,
@StopRow as int = null
AS
Set RowCount @StopRow
select vchUserId,vchNewsTitle into #tmp1 from tb_UserNews
exec('alter table #tmp1 add rownum int IDENTITY (1, 1) primary key NOT NULL')
SELECT * FROM #tmp1
WHERE rownum >= @StartRow
ORDER BY rownum drop table #tmp1
GO
ALTER proc Getauthors
@StartRow as int = null,
@StopRow as int = null
AS
Set RowCount @StopRow
select vchUserId,vchNewsTitle into #tmp1 from tb_UserNews
exec('alter table #tmp1 add rownum int IDENTITY (1, 1) primary key NOT NULL')
SELECT * FROM #tmp1
WHERE rownum >= @StartRow
ORDER BY rownum drop table #tmp1
GO
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货