Reputation: 6765
I have imported my database to a new ms sql server. This works but the logins are not working. They exists on the database itself but they are not available in the security->logins area of the ms sql server. I tried to create them manually there but receive the exception that they already exists on my database.
How can I achieve that these logins are active for my new ms sql server?
Thanks
Upvotes: 1
Views: 255
Reputation: 6765
Found the solution which works for me
USE testdb;
GO
EXEC sp_change_users_login 'Auto_Fix', 'testuser', NULL, 'testpwd';
GO
Upvotes: 1
Reputation: 1441
Add the logins to the server, but don't associate them with the database. Then, run this:
USE [your database];
GO
ALTER USER {user} WITH LOGIN={login};
Upvotes: 1