List of tables without permissions to public

  • Hi, List!

    I have many databases with many tables.

    I want to get a list of tables that group public doesn't have permissions for them for each database.

    Thanks beforehand for help.

  • There are quite a few examples in the scripts about how to run against multiple databases. Here's what you need to find the tables the public group has no permissions for (SELECT, INSERT, UPDATE, or DELETE).

    SELECT so.name
    FROM sysobjects so
      LEFT JOIN
      ( SELECT id
        FROM sysprotects
        WHERE uid = USER_ID('public')
      ) sp
    ON so.id = sp.id
    WHERE sp.id IS NULL
      AND XTYPE = 'U'
    

    K. Brian Kelley
    @kbriankelley

  • Thank you very much for your help.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply