这个存储过程错在哪儿?
OmT 2004-11-22 02:54:27 对储存过程不熟,照着写了一个存储过程,如下:
create proc abc
@currentpage int=1
as
select top 15 * from TestTable
where (id>(select Max(id) from(select top 15*@currentpage id from TestTable order by id) as T))
go
分析时提示:
服务器: 消息 170,级别 15,状态 1,过程 abc,行 5
第 5 行: '@currentpage' 附近有语法错误。
如果把15*@currentpage换成一个具体的数字就不会出错!