I found this nice answer on SO that uses the sp_change_users_login stored procedure for this.
You can use sp_change_users_login to create a login for users already in the database.
USE databasename -- The database I recently attached EXEC sp_change_users_login 'Report' -- Display orphaned users EXEC sp_change_users_login 'Auto_Fix', 'UserName', NULL, 'Password'You get the UserName(s) from the sproc when you run it with @Action='Report'.
No comments:
Post a Comment
Thanks for taking the time to provide feedback!
Cheers,
Nicky