| 发表于:2007-07-26 11:02:325楼 得分:35 |
terrence1106(曾阿牛) ( ) 信誉:99 2007-07-26 10:47:14 得分: 0 haiwer(海阔天空) ,倒数第四行 还有个 ,@indextable ,换成#indextable 也不对;还多了两个where 用这句测试还是有问题 getpagedxwthird_thesis 1,1, '0 ', "where thesisname like '%op% ' " 服务器: 消息 156,级别 15,状态 1,行 2 在关键字 'table ' 附近有语法错误。 服务器: 消息 156,级别 15,状态 1,行 10 在关键字 'where ' 附近有语法错误。 --------- 代碼中有幾處錯誤,修改下。 create procedure getpagedxwthird_thesisbak ( @pagesize int, @pageindex int, @docount bit, @wherestr nvarchar(1000)) as set nocount on if(@docount=1) EXEC ( 'select count(thesisid) from thesis '+ @wherestr) else begin EXEC( ' create table #indextable (id int identity(1,1),nid int) declare @pagelowerbound int declare @pageupperbound int set @pagelowerbound=( '+@pageindex+ '-1)* '+@pagesize+ ' set @pageupperbound=@pagelowerbound+ '+@pagesize+ ' set rowcount @pageupperbound insert into #indextable(nid) select thesisid from thesis '+ @wherestr+ ' order by thesisid asc select thesistype,thesisname,pivotal,author,workplace,magazinename,wholeno,thesisyear from thesis inner join #indextable t on thesisid=t.nid and t.id> @pagelowerbound and t.id <=@pageupperbound '+ @wherestr+ ' order by t.id ') end go 執行語句應該是這樣 getpagedxwthird_thesis 1,1, '0 ', 'where thesisname like ' '%op% ' ' ' | | |
|