Monday, March 12, 2012

multiple tables in grant statement

hello everyone,
is it possible to list multiple tables in a grant statement.
so instead of using:
GRANT ALL ON AuditColumns TO ADMIN
GRANT ALL ON AuditConfig TO ADMIN
i can just use:
GRANT ALL ON AuditColumns, AuditConfig TO ADMIN
thank you for your help,
abraham lunaIt cannot be done :(|||You can do it an easy way:
SELECT 'GRANT SELECT ON ' + table_name + ' TO whoever', *
FROM INFORMATION_SCHEMA.tables
Run this, obviously add some WHERE criteria to limit the tables, copy the
result set to the main window and execute that. Easy eh?
Let me know how you get on.
Damien
"Abraham Andres Luna" wrote:

> hello everyone,
> is it possible to list multiple tables in a grant statement.
> so instead of using:
> GRANT ALL ON AuditColumns TO ADMIN
> GRANT ALL ON AuditConfig TO ADMIN
> i can just use:
> GRANT ALL ON AuditColumns, AuditConfig TO ADMIN
>
> thank you for your help,
> abraham luna
>
>|||ty for your reply
i ended copying and pasting lots of those statements and then modifying it
as needed

No comments:

Post a Comment