One of these;
set @reportmanager = (select managerid from reportingperson where employeeid=@userid)
set @admintype = (select admintype from employee where content_id=@userid)
are returning more than one value and you cannot assign a list of
int
s to a single
int
.
Since you're only using those for the first if-statement you might be able to change them to
set @reportmanager = (select count(managerid) from reportingperson where employeeid=@userid)
set @admintype = (select max(admintype) from employee where content_id=@userid)
as I am guessing you're only making sure that they're there or not there.
Having said that, without seeing your actual table structure and knowing what you're trying to select it's difficult to help.
/Fredrik