Thursday, March 22, 2012

Duplicate an existig SQL user login account

How does one create a copy of an existing SQL login account. I have a
database that has a single login with everything setup. I just want to be
able to copy the existing account to a new user so I can set a different
password.
Thanks!You might be able to get what you want by "Generating SQL Script" from
the right-click context menu on the database you want to add the user
to. Place the checkmarks on the first tab to create all types of
objects, uncheck the options to create the CREATE and DROP statements on
the second tab, and go to the 3rd tab and check "Script object-level
permissions".
When you build the script, it should include commands that grant the
permissions to the current account that holds the permissions. You will
have to manually pick through the script commands to find the
appropriate ones and change the name of the user to replace the old
user's username with the new one to build an entirely new script.
While not the answer you're looking for, I think you should consider
creating one or more roles configured to grant permissions that match
the account that is configured properly now, then create the new account
and add the both user accounts to the role you created.
Good luck,
Tony Sebion
"John Williams" <JohnWilliams@.discussions.microsoft.com> wrote in
message news:5EA1D83E-15E9-44B9-9707-C4AAB5C9CDB6@.microsoft.com:

> How does one create a copy of an existing SQL login account. I have a
> database that has a single login with everything setup. I just want to be
> able to copy the existing account to a new user so I can set a different
> password.
> Thanks!sql

No comments:

Post a Comment