add a role to all databases?

  • isn't there a way to add a role to all databases?

    i remember seeing some thing like that, but don't

    remember how to do it.

    thoughts?

    _________________________

  • more information...

    with a single script... add a role to ALL

    databases.

    thoughts?

    _________________________

  • after you've added the roll to all existing user-db, also add it to model database.

    that database is used (copied) to create every new db !

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • right... but question remains on how to

    add a single role to all databases at once.

    thoughts?

    _________________________

  • Might want to look into using ms_foreachdb...

    sp_msforeachdb 'sp_addrole ''role_name'' '

  • sorry... sp_msforeachdb (got it right in the example).

  • cool... thanks! i knew it was out there some where.

    one other question... i'm reading mixed reviews

    on the process.

    has there ever been any incomplete issues with this?

    sp_msforeachdb 'sp_addrole ''role_name'' '

    where by some databases have the role added, and others

    do not?

    just wondering.

    thanks by the way for the feed back.

    _________________________

Viewing 7 posts - 1 through 6 (of 6 total)

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