Friday, March 23, 2012

Restore database need to recreate a user

Everytime I restored a user database, I need to delete a user of that
database and recreate the same one, otherwise my application cannot connect
to that database.
Any idea ?http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://www.databasejournal.com/feat...cle.php/3379901 Moving
system DB's
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.sqlservercentral.com/scr...sp?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
Andrew J. Kelly SQL MVP
"Man Utd" <alanpltseNOSPAM@.yahoo.com.au> wrote in message
news:uhF4RAXkFHA.3288@.TK2MSFTNGP09.phx.gbl...
> Everytime I restored a user database, I need to delete a user of that
> database and recreate the same one, otherwise my application cannot
> connect
> to that database.
> Any idea ?
>|||Hi,
No need to recreate the user. You could re-sync the Logins and users using
the below system stored procedure.
sp_change_users_login 'update_one','user_name','login_name'
See more details of this procedure in books online
Thanks
Hari
SQL Server MVP
"Man Utd" <alanpltseNOSPAM@.yahoo.com.au> wrote in message
news:uhF4RAXkFHA.3288@.TK2MSFTNGP09.phx.gbl...
> Everytime I restored a user database, I need to delete a user of that
> database and recreate the same one, otherwise my application cannot
> connect
> to that database.
> Any idea ?
>

No comments:

Post a Comment