I have this situation and would like your advise and help to understand
This is ASE 15.0.3 ESD#1 on solaris 10

two databases db01 & db02
two logins with direct mapping to both databases user01 & user02
two tables in database db02 user01.table01 & dbo.table01
multiple SPs to truncate & insert records in userxx.table01 .. SP is created
in db01 and looks like this

use db01
go
setuser 'user01'
go
create procedure SP001
as
insert db02..table01( ...any values)
go
Grant Execute on user01.SP001 to AdminGroup
go

The situation
1) If I created the procedure with "sa" - it does not work correctly and
always accessing the dbo.table01 instead of user01.table01
2) If I drop the SP and created it with equivalent login "e.g. user01" - it
works correctly and accessing the table equivalent to that login (e.g.
user01.table01)
3) if I just execute the sql statement with no SP in SQL session with that
user - it workd correctly and goes to the proper table.

Can you please advise on that behavior of "setuser"