MSSQL database migration user problem

Just working moving some MSSQL databases to a shiny new server and came across this lovely little problem.

If you restore a database to a different server the user permissions get messed up.

For example if you have a user called webuser on both servers, when you restore the database to the new server and look at the users for the DB it will look as if the webuser has access to the DB.

However, the key issue is that the "login name" field will be empty, and this is because the internal user id of the webuser from the old server and the webuser from the new server are different.

To solve the problem simply delete the user from DB, and add them again. This will then use the correct userID and all will be good.

Hope this saves someone some time.

Cheers, Mark

Related Blog Entries

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.