Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename a role?

Status
Not open for further replies.

aimlion11yahoo

Instructor
Jul 20, 2006
42
US
Is there a way to rename a role? I don't want to spend the time setting up all the permissions associated with the role.

Thanks,

 

EXEC sp_configure 'allow updates', 1
RECONFIGURE WITH OVERRIDE
GO

Update sysusers set name = 'new name' where name = 'old name' and
issqlrole = 1
GO

EXEC sp_configure 'allow updates', 0
RECONFIGURE WITH OVERRIDE
GO
 
Updateing the system tables is NEVER recommended. This thread thread962-1324602 shows code for SQL 2000 and SQL 2005 which will allow you to see all the rights which have been granted as well as generate code to reset the permissions.

This will allow you to generate a list of the permissions on the current role. Copy and paste that code into notepad and do a search and replace for the old name to the new name. Then create the new role, and run the code with the new role name.

Add the users to the role, and you are done.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top