Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
leeholden
Starting Member
34 Posts |
Posted - 2002-08-06 : 07:26:14
|
| Is there a quick and easy way to clone logins.I want to create a new user that has exactly the same permissions as another user. They have access to 3 databases and are in a couple of roles within each database, but I also know for a fact that they have some permissions on individual tables. I don't want to have to write them all down and then tick all of the relevant boxes manualy (yawn!)(actual we use NT authentication and he has just had his NT login changed and I need to reflect the change on the SQL server - but it would be useful to know anyway) |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-08-06 : 07:40:19
|
| Neither quick nor easy AFAIK. Basically you would run sp_helprotect for the user you want to clone and get their permissions. You'd have to run sp_helpuser to get their role membership too. You could put this data into a table and then using either a cursor or a big dynamic SQL string create the GRANT statements to apply those permissions to the other user.If you expect you might have to do this in the future, it might be better to create a database role and manage all permission for the role, and never specify permissions for a user. It's not any more difficult that setting permissions for users, and it lets you instantly grant multiple users the same settings. |
 |
|
|
|
|
|