how can I script all objects without permissions (Grants) ?
robert
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"robert madrian" <off...@madrian.at> wrote in message
news:elv1ToJi...@TK2MSFTNGP04.phx.gbl...
Could you rephrase the question please? it's not clear if you are asking
how to script all objects that have no permissions granted on them, or
if you need to script objects with a user account that does not have
permissions on the objects.
The latter certainly does not sound as if it will be possible.
--
HTH,
Bob Barrows
I want to script all objects that have no permissions granted on them...
in SMSS it is to much work to go through all objects and look if there is a
permissions granted on them
regards
"Bob Barrows" <reb0...@NOyahoo.SPAMcom> schrieb im Newsbeitrag
news:uAVl8sJi...@TK2MSFTNGP06.phx.gbl...
As to figuring out how to generate the CREATE scripts, you should use
SQL Profiler to trace what the wizard does while generating scripts.
--
HTH,
Bob Barrows
regards
"Bob Barrows" <reb0...@NOyahoo.SPAMcom> schrieb im Newsbeitrag
news:uFdlXaKi...@TK2MSFTNGP02.phx.gbl...
It appears you simply need to do an outer join between
sys.database_permissions and sys.objects, like this:
select o.name,type_desc from sys.objects o left join
sys.database_permissions p
on o.[object_id]=major_id
where o.type in ('u','p','v','pc','fn','fs','ft','if','tf','sn','x')
and major_id is null
order by type_desc,o.name;
Again, this only excludes objects with explicit permissions. If you need
it to exclude objects with inherited permissions you need to let us
know.
--
HTH,
Bob Barrows
I have read over - your are right I use SQLServer 2005 and and you have
solved my problem
thank's
"Bob Barrows" <reb0...@NOyahoo.SPAMcom> schrieb im Newsbeitrag
news:eTJQ0lLi...@TK2MSFTNGP06.phx.gbl...