no

How to Fix Login Failed for User in Mssql

Often you will encounter this error if you are restoring a database from one machine into another. What causes the error: On a full backup o...

Often you will encounter this error if you are restoring a database from one machine into another.

What causes the error:
On a full backup of the database, it includes all the objects within it like tables, views, procedures, etc and also the users.

So when we restore the database on another machine, and the user is not on that machine. Or if it is there, the mapping would be deleted.

What to do:

1.) Execute this:
exec sp_revokedbaccess 'username'
http://msdn.microsoft.com/en-us/library/ms188909.aspx
This would delete the carried user in the database

2.) Now open your MSSQL Server Managerment Studio

3.) Click Security->Logins

4.) Right click the "user" click Properties, and in the "User Mapping" tab click the appropriate rights that we want the user to have for the database chosen

Related

rdbms 7489830674623755124

Post a Comment Default Comments

1 comment

Anonymous said...

Thanks a lot. I and another colleague of mine spent a lot of time figuring out this issue but finally resolved it with your solution.

Outsourcing

Are you looking for freelancers in the Philippines? Get in touch.

Donations

If you like what I do, you can support this channel by buying me a coffee. I would be grateful for your contribution! Your donations will help me create more FREE online courses and learning materials for programmers and remote workers.

item