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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database Login Broken

Author  Topic 

Gyto
Posting Yak Master

144 Posts

Posted - 2007-07-03 : 04:50:09
Hi there, wasn't quite sure where to put this but I still regard myself as a bit of an SQL Server noob so thought it'd be ok here....hopefully?! lol

Right....I have a database called CDR and a Login set up for this on the server called CDMLogin. The CDR database is a non-live backup of another database stored elsewhere. In order to update this for testing purposes I needed to make a backup of the live database and then do a 'restore database' over the top of the old CDR one. This has worked fine before.....however, on this occasion, the link between the CDR database and the CDMLogin appears to have been broken. I have since read about how this can be an issue when restoring databases but I have still not found a fix. Any ideas?

Thanks v much

nr
SQLTeam MVY

12543 Posts

Posted - 2007-07-03 : 07:10:55
The user in the database is linked to the id for the login. On other servers the id may be different for the login so when the database is restored the link is broken. You have to match up the user wit the login again.
It may be an issue if another user happens to use that login id in which case you can change the login id for the login or change both the users involved.

Have a look at sp_change_users_login
or you might need to drop and create the user (or login)


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -