Migrating Local SQL Database User Accounts to Another SQL Server With an Unknown Password

I needed to move a database from a SQL 2005 server to SQL 2008 server.  I had no problems backing up and restoring the database to the other server, but the database had a local user account created for services on the application server with which to authenticate.  I did not know the user’s password to manually recreate the user on the new database server.  [more]

What I found from this helpful article http://www.techrepublic.com/blog/howdoi/how-do-i-transfer-logins-from-one-sql-server-2005-instance-to-another/140 is a script that you can run to get all of the user accounts displayed in a nice SQL syntax that you can copy and paste into the new database server.

After you recreate the user account, the next step is to resynchronize logins to fix permission settings.

Even if you do not have the password for local SQL user, you can recreate the user on another server using this method.

General SQL Server SQL Server 2008