sql 2000不支持,sql 2005及更高版本可以支持。
sql 2000 可以使用临时表配合 identity函数来实现类似功能
select IDENTITY(int,1,1) as rowId , * into #tb from bless where
(id=@id or @id=0) and
(author=@author or @author='') and
(zhufu=@zhufu or @zhufu='')and
(@month=0 or month(createdate)=@month)
order by createDate desc
select rowId,id,[user_id],author,zhufu,contents
,style,photo,createDate,topNum,leftNum
from #tb A
where A.rowId >= @start and A.rowId <= @end
order by createDate ASC
drop #tb