How to get list of tables, views etc. a users has rights to on Sybase IQ

sybasesybaseiq

I'm looking for a way to get a list of views, tables, procesdures etc, a user has been granted to. A select onto SYSROLEGRANTS helped me to find basic role of users — but not more like this.

So e.g. Having this:

create or replace view myFancyView as
SELECT * from mytable;

GRANT SELECT ON myFancyView TO myUser;

I'm hoping for a list like that:

|User  | Right                |
|------|----------------------|
|MyUser| SELECT ON myFancyView|

Best Answer

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36273.1570/html/sprocs/X22708.htm lists the system stored procedure, sp_helprotect which provides a mechanism for displaying all the rights a user has in a given database.

From that document:

Displays all the permissions that “judy” has in the database:

sp_helprotect judy

Related Question