How to associate a SQL hrnet user correctly

The hrnet SQL user attached to the hrnet database is not synchronised with the hrnet SQL user correctly on the server

The following symptoms can occur:

1. When logging in to the HR.net web application the screen brings up a pop-up but the pop-up displayed just shows another log-on screen.

2. Error Message when logging in to the HR.net web application of
“Cannot open database requested in login ‘hrnet’. Login fails. Login failed for user ‘hrnet’.”

3. When attempting to associate the hrnet user with the hrnet database in SQL Enterprise Manager the following error is displayed, “Error 21002: [SQL-DMO]User ‘hrnet’ already exists.”

This is caused by hrnet SQL user assigned to the hrnet database is not correctly aligned / associated with the actual SQL user.

To resolve this issue Run the SQL script below on the hrnet database.

This script will re-align / re-associate the hrnet user on the database with the hrnet user on the actual SQL server.

sp_change_users_login ‘update_one’,’hrnet’,’hrnet’

This entry was posted in SQL Server. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *