Hi,

I have restored a backup of a database to a different server.

This target server had a login for the a user (called user1) in the database I just restored. That login, also owned objects in the database I restored.

When I try to connect to the database, it says
'Cannot open Default database. Login failed'
Login failed for user 'user1'

I have tried via Management studio to change the default database for the login 'user1'. This is successful (i.e. there are no errors when I change the default database through the gui).

But When I try to login with that user (user1) i get the error listed above.

I have tried to use

sp_change_users_login <db_name>, 'user1', 'xxxxx'

and

ALTER LOGIN user1
WITH DEFAULT_DATABASE = <db_name>
GO

Without success. The problem is that user (user1) owns objects and is a schema owner as well.

Any thoughts?

Thanks,