does anybody see a problem with this?Hey run this SELECT dp.class_desc, dp.permission_name, dp.state_desc,ObjectName = OBJECT_NAME(major_id), GranteeName = grantee.name, GrantorName = grantor.name FROM sys.database_permissions dpINNER JOIN sys.database_principals grantee ON dp.grantee_principal_id = grantee.principal_idINNER JOIN sys.database_principals grantor ON dp.grantor_principal_id = grantor.principal_id WHERE grantee.name <> 'public'ORDER BY OBJECT_NAME(major_id)Then thisSELECT 'GRANT INSERT, SELECT, UPDATE, DELETE ON ' + TABLE_NAME + ' TO Diversity_User99_Role'FROM INFORMATION_SCHEMA.TablesWHERE TABLE_NAME NOT IN ( SELECT DISTINCT grantee.name FROM sys.database_permissions dp INNER JOIN sys.database_principals grantee ON dp.grantee_principal_id = grantee.principal_id INNER JOIN sys.database_principals grantor ON dp.grantor_principal_id = grantor.principal_id WHERE grantee.name <> 'public')ORDER BY TABLE_NAME
I'm seeing tables that already have a grant...I'm confusedBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam