本文介绍了我得到的错误是:在预期条件的上下文中指定的非布尔类型的表达式,在'R'附近。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

alter procedure ListEmployeedtls_Paging

as
begin
Declare @result nvarchar(700);
Declare @orderby nvarchar(700);
Declare @PageSize nvarchar(200);
Declare @PageNum nvarchar(200);
Declare @Offset nvarchar(200);
--set @orderby=' order by e.EmpId desc';

set @PageSize=10
set @PageNum=2
set @Offset=@PageSize*(@PageNum-1)

set @Result='select Top '+@PageSize+' e.EmpId
,(e.FirstName+'' ''+e.LastName) as EmpName
,e.EmpMobile
,e.EmpGender
,e.EmpAddress
,e.IsActive
,e.EmpEmail
,e.EmpSalary
,d.DeptName


from Employeedtls e left outer join Department d on d.DeptId=e.DepartmentId
left outer join Grade g on g.GradeId=e.GradeId 
left outer join User_Role r on r.RoleId=e.RoleId
left outer  join Employeedtls s on e.SupervisorId=s.EmpId 
where 1=1  and e.EmpId not in

 (select  top '+@Offset+' e1.EmpId
from Employeedtls e1 left outer join 
Department d1 on d1.DeptId=e1.DepartmentId
left outer  join Employeedtls s1 on e1.SupervisorId=s1.EmpId
left outer join Grade g1 on g1.GradeId=e1.GradeId 
left outer join User_Role r1 on r1.RoleId=e1.RoleId
 where 1=1)'

print @Result
	
	
print @Result+ @orderby

exec (@Result + @orderby)
end





我尝试了什么:



感谢Advance中的帮助



What I have tried:

Thanks for the help in Advance

推荐答案

Declare @result nvarchar(1000);


这篇关于我得到的错误是:在预期条件的上下文中指定的非布尔类型的表达式,在'R'附近。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 17:02