Re: [iqug] IQ equivalent for sp_helprotect

399 views
Skip to first unread message
Message has been deleted

Yakov Y

unread,
Apr 8, 2011, 12:56:12 PM4/8/11
to iq...@googlegroups.com
I am not sure if there is such sp. I use the following queries to get object permissions

for tables

select user_name(grantee) from systableperm where stable_id = yourtableid

for sp

select user_name(grantee) from sysprocperm where proc_id= yourprocid



On Fri, Apr 8, 2011 at 12:49 PM, Shah, Jinesh <Jinesh...@morganstanley.com> wrote:

Hi ,

Would you know if there is a Sybase IQ equivalent of sp_helprotect command.

 

Thanks

Jinesh Shah


NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.

--
You received this message because you are subscribed to the Google Groups "iqug" group.
To post to this group, send email to iq...@googlegroups.com.
To unsubscribe from this group, send email to iqug+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/iqug?hl=en.

Mark Mumy

unread,
Apr 8, 2011, 3:46:27 PM4/8/11
to iq...@googlegroups.com

Something link this to get permissions for an object, or list of objects.  This assumes you are on 15.2 where the LIST() function was implemented in IQ.

 

Select

                convert(char(10),s.table_name) table_nm

                , convert(char(10), u.user_name) grantee

                , convert(char(10),u1.user_name) grantor

                , convert(char(20), list(

                                case when selectauth = 'Y' then 'select,' else '' end ||

                                case when insertauth = 'Y' then 'insert,' else '' end ||

                                case when deleteauth = 'Y' then 'delete,' else '' end ||

                                case when updateauth = 'Y' then 'update' else '' end

                ) ) as perms

 

from sys.systable s, sys.systableperm p ,sysuserperm u, sysuserperm u1

where

s.table_type = 'BASE'

and s.server_type = 'IQ'

and (s.table_id = p.stable_id)

and (u.user_id = p.grantee)

and (u1.user_id = p.grantor)

 

-- comment out if you want all tables

and (s.table_name like '%TABLE_NAME%' )

 

-- if you want to use the owner name too uncomment these lines

--and (s.creator = u1.user_id)

--and (u1.user_name like '%OWNER_NAME%' )

 

group by s.table_name , u.user_name, u1.user_name

 

go

 

Mark

============================================================

Reply all
Reply to author
Forward
Message has been deleted
0 new messages