Hi All,
Does someone have a procedure that will loop through ALL databases and get
the object priviledges for ALL users in the database?
Thanks...MHi
From Aaron Bertrand
This will only cover those who have
been explicitly given access to the procs using GRANT.
DECLARE @.username VARCHAR(32)
SELECT @.username = '?'
SELECT o.name, CanExec = CASE WHEN p.id = o.id THEN 'Yes' ELSE 'No' END
FROM sysobjects o LEFT OUTER JOIN syspermissions p
ON o.id = p.id
AND p.grantee = USER_ID(@.username)
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:OPhCB0$VFHA.2684@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> Does someone have a procedure that will loop through ALL databases and get
> the object priviledges for ALL users in the database?
> Thanks...M
>|||Hi,
Execute SP_helprotect from Query Analyzer. This will give you the full
permission for all users in a database. If you have multiple database then
either execute the stored procedure sepeeately for each databases or write a
script to fire this procedure for all databases.
Thanks
Hari
SQL Server MVP
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:OPhCB0$VFHA.2684@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> Does someone have a procedure that will loop through ALL databases and get
> the object priviledges for ALL users in the database?
> Thanks...M
>
No comments:
Post a Comment