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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 query on db restore process...

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-01-03 : 14:17:16
Ahmed writes "Hi,

I have one quick query on process of restoring the SQL database.

I had taken the backup of existing database and tried to restore it on production server. The database was restored successfully. But I was not able connect to the database with the given user. Let me explain it with the below example...

Lets say the DB Name is "TESTDB" and login user id is "TESTUSER". The owner of all the tables is "TESTUSER".

Now, I took the full db backup of "TESTDB" and resoted it on another server. Then I tried to connect to that DB with the user "TESTUSER" but in vain. In order to fix this issue, I ran the below query.

use TESTDB
sp_change_users_login "update_one","TESTUSER","TESTUSER".

My query is, why should i run the above query? is it mandatory to run the above query to fix this problem? plz provide your feedback on this issue.

Thanks in advance

Regards
Ahmed"

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-03 : 14:26:43
You need to run the query if the sids don't match. That's why I use this prior to my restores:
http://www.sqlmag.com/articles/index.cfm?articleid=16090&

Tara Kizer
Go to Top of Page
   

- Advertisement -