Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / March 2008

Tip: Looking for answers? Try searching our database.

SqlServer 2000 DB Restore - User Does not have a  Login Name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tmuldoon - 03 Mar 2008 16:11 GMT
Hello,

A system that houses an app and it's database was restored.

The database called testdb has a user called testdbuser.  When I check
the users for this db - it shows testdbuser - the properties show the
Login Name as <none> after the restore.

In the Security Folder - testdbuser does not exist.  I tried to
recreate it and give the the correct password and database access.
However, when I do that - it says the 'users already' exists.

It will not let me drop testdbuser from the db because it is the owner
of tables.

However when the app tries to access it - it says:
Cannot open database requested in login 'testdb'. Login fails.

When I try to login with query analyzer, I get
Login failed for testdbuser

Previous to this restore - it used to work.

How can I rename the login to 'testdbuser' as it was previously?

Any other suggestions?

Thanks,

Tmuld
Tibor Karaszi - 03 Mar 2008 16:25 GMT
Check out sp_change_users_login, documented in Books Online. You also might want to Google
sp_help_revlogin, for an alternate way to handle this situation.

Signature

Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi

> Hello,
>
[quoted text clipped - 26 lines]
>
> Tmuld
Adi - 03 Mar 2008 16:32 GMT
> Hello,
>
[quoted text clipped - 26 lines]
>
> Tmuld

There is a difference between login and user.  Make sure that the
login exists on the new server.  If the login doesn't exist, then
create it on the new server.  If the login is SQL Server login, you'll
also have to run   sp_change_users_login 'update_one', 'UserName',
'LoginName'.  Of course you have to specify the real username and
loginname.   You have to run this procedure in the database TestDB.  I
recommend that you'll read about sp_change_users_login at BOL.

Adi
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.