declare@strsql varchar(8000)='' declare@strsql2 varchar(8000)='' 还有:if @sex is not nullset @strsql2='where userSex=N'''+@sex+'''' 还有:else
set@strsql='select top '+str(@PageSize)+' userId,userName,userSex,userAge,userSch from UserZiliao where userId not in --top 后少个空格...