Home > database >  Message 102, level 15, state 1, line 26 "=" near a syntax error. What reason be? Pure whit
Message 102, level 15, state 1, line 26 "=" near a syntax error. What reason be? Pure whit

Time:09-23

The alter proc p_mypage
@ tablename varchar (20),
@ fields varchar (200),
@ olderfields varchar (200),
@ the where varchar (200),
@ pagesize int=4,
@ pageindex int=1,
@ recordcount int the output,
@ pagecount int the output
As
Declare @ SQL nvarchar (4000)
Set @ SQL='select @ recordcount=count (*) from the' + 'where1=1 + @ tablename + isnull (@ the where,' ')
The exec sp_executesql @ SQL, N '@ recordcount int the output', @ recordcount output
The set @ pagecount=between ((@ recordcount + 0.0)/@ pagesize)
The set @ SQL='
Select * from (
Select top '+ (convert (varchar (20), @ pagesize)) +' '+ @ fields,' the from (
Select the top '+ (convert (varchar (20), @ pagesize * @ pageindex)) +' * from '+ @ tablename +'
Where 1=1
The order by '+ @ olderfields +') as a
The order by a. '+ @ olderfields +' desc) as b
The order by b. '+ @ olderfields
The exec (@ SQL)
Go

Declare @ a int, @ b int - line (26)
The exec p_mypage @ tablename='student', @ fields='*',
@ olderfields='studentno, @ the where=null,
@ pagesize=4, @ pageindex=1, @ recordcount=@ a output,
@ pagecount=@ the output b
Print @ a
Print @ b


Line 26 no equal sign?
And when I choose the last line from line 26 to run the show 26 line has a problem, but when I choose from 25 line (the line what also have no) at the end of the run time shows that there is something wrong with the line near the equals sign 25, dizzy,

  • Related