home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,086 of 19,505   
   Lutz Uhlmann to All   
   Re: transfering full backup from one ser   
   21 Jan 11 08:45:26   
   
   From: news@invalid.invalid   
      
   > Let say we have user1 in datebase1   
   >   
   > Now we create login user1 and try to map that login to database1   
   >   
   > But now we got error, something like 'User, group or role 'user1' already   
   > exists in the current database ...'   
   >   
   > Is there any different way, remapping or somthing?   
   > What to do in this case?   
      
   You can use sp_change_users_login   
      
   The first time you restore the backup on another server you have to   
   crate the login for your database user:   
   EXEC sp_change_users_login 'Auto_Fix', 'User1', Null, 'user1password'   
   GO   
      
   After this Login User1 exists on the new server.   
   Now you can use a shorter version to reconnect User and Login:   
   EXEC sp_change_users_login 'Auto_Fix', 'User1'   
   GO   
      
   For an overview try:   
   EXEC sp_change_users_login 'Report'   
   GO   
      
   Look at online-help for all informations ...   
   http://msdn.microsoft.com/en-us/library/ms174378.aspx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca