Home » Databases » HOWTO: Extract Permissions from SAP Sybase IQ

HOWTO: Extract Permissions from SAP Sybase IQ

Kudos to Casshern:

SELECT 'grant ' + 
    (CASE stp.selectauth
        WHEN 'Y'
        THEN 'select '
     END
     CASE ) + (
        CASE stp.deleteauth
           WHEN 'Y'
           THEN ', delete '
        END
        CASE ) + (
        CASE stp.updateauth
            WHEN 'Y'
            THEN ', update  '
        END
        CASE ) + (
        CASE stp.alterauth
            WHEN 'Y'
            THEN ',  alter '
        END
        CASE ) + (
        CASE stp.referenceauth
            WHEN 'Y'
            THEN ', reference '
        END
        CASE ) + (
        CASE stp.insertauth
            WHEN 'Y'
            THEN ', insert '
        END
        CASE ) + 
   ' ON ' + USER_NAME(st.creator) + '.' 
    + st.table_name + ' TO ' 
    + USER_NAME(stp.grantee) + ';'
FROM
    systable st,
    systableperm stp
WHERE stp.stable_id = st.table_id
Sybase

Sybase

UPDATED: HOWTO: Extract Permissions from SAP Sybase IQ

Share Button

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Facebook login by WP-FB-AutoConnect