SQL Server Performance

Need to Script User Role Membership

Discussion in 'SQL Server 2005 General DBA Questions' started by prabhabk, Apr 11, 2009.

  1. prabhabk New Member

    I have not been able to find the functionality to script user's role membership for databases in SQL 2005.
    In SQL 2000, I could right click on a database and go to All Tasks>Generate SQL Script and go to the Options tab and select 'Script database users and database roles' and it would give you the sp_grantdbaccess and sp_addrolemember statements to recreate the users correctly.
    In SQL 2005, I can script users, which gives me the 'Create User' statement. And I can script roles, which gives me the 'Create Role' statement. But I cannot get the script for the sp_addrolemember statement for each user in the database.
    It seems like some basic functionality that was in 2000 and should be in 2005, but isn't

  2. MohammedU New Member

Share This Page