Whilst working with SAP ASE, I found it useful to have a ready made SQL statement for determining who (which user accounts) has “allow hadr login” privileges.
In my scenario, I needed to be able to check if a specific backup server login account had the “allow hadr login” privilege, to permit backups of a standby SAP SRS replicated database.
Normally you are unable to login as any “normal” user into the standby database without the “allow hadr login” privilege.
use master
go
select p.uid,u.name,CONVERT(char(20),v.name)
from sysprotects p,
master.dbo.spt_values v,
sysusers u
where p.action=v.number
and v.name=’Allow Hadr Login’
and p.uid = u.uid
go