Showing posts with label re-associate. Show all posts
Showing posts with label re-associate. Show all posts

Friday, March 9, 2012

Re-associate server login with database user?

Hi all, I've had this issue in the past but dealt with it in a way that I don't think is correct:

Let's say I have a database on Server1. On Server1 I create a login and a user on the database. Now I have User1 with a login authorization on Server1 as well as a user within my database. If I detach that database now, and re-attach it on a different server, User1 exists. Of course, on the new Server2 User1 does not have authorization to login. I've deleted the existing user in the database and then re-created a login on the server, cascading through with the GUI setup to re-create the user within the database, too. Of course this gets ugly if the user has objects within the database. If I create a server login with the same name as the database user the login is not associated with the user too, correct?

I'd like to know the way that I can create a server authorization tied to the existing database user without dropping that database user, preferably within Enterprise Manager.

Thanks all,

MCNot sure if this solves your situation, but look into this:

http://blogs.geekdojo.net/ryan/archive/2004/05/04/1849.aspx

re-associate "dbo" user with "sa" login

Once "dbo" user on a particular db has been associated with a specific login
( "Login1") , how to re-associate it with its default login ( "sa" ) ?
My ultimate goal is to add user "User1" to this db and associate it with
login "Login1" . but to do that apparently I need to de-associate "Login1"
login from "dbo" user.It sounds like the user is the database owner. You can
change the owner to sa by executing the following in the
database:
exec sp_changedbowner 'sa'
-Sue
On Thu, 27 Jul 2006 11:15:59 -0700, "John A Grandy"
<johnagrandy-at-yahoo-dot-com> wrote:

>Once "dbo" user on a particular db has been associated with a specific logi
n
>( "Login1") , how to re-associate it with its default login ( "sa" ) ?
>My ultimate goal is to add user "User1" to this db and associate it with
>login "Login1" . but to do that apparently I need to de-associate "Login1"
>login from "dbo" user.
>