SELECT .....
FROM sysprocesses p
JOIN syslogins l
ON l.id = p.suid
JOIN sysdatabases d
ON d.id = p.dbid
CREATE VIEW ALL_USERS AS
SELECT dbid('first_app_db') as dbid,
id as uid
name
FROM first_app_db..sysusers
UNION ALL
SELECT dbid('second_app_db') as dbid,
id as uid
name
FROM first_app_db..sysusers
UNION ALL
SELECT dbid('third_app_db') as dbid,
id as uid
name
FROM first_app_db..sysusers
We also need more information from you. Which Sybase product? (Sybase has several database products). If you mean Sybase ASE, do you mean you want to know about the logins (server-wide), database users (per database) or application users (could be either of these or something else entirely)?