Question : Change SQL database Authorization from MIXED MODE to User Name and Password

I recently setup SQL 2008 R2 and set the authoriization to MIXED MODE.  The database I moved to this new Server has the database set to User Name and Password, which of course I have both the User Name and Password.  I would like to change the SQL 2008 copy to the same User Name and Password.  The main reason for doing so is so my existing code in web.config should work with no changes.

Answer : Change SQL database Authorization from MIXED MODE to User Name and Password

use:

USE sql_song1;
GO
exec sp_change_users_login 'Update_One', 'leon', 'leon';
go

This solution assusmes you created a SQL account named leon within the SQL server, not the OS!

The other solution sp_revlogin mentioned by me and rrjeagan17 has to do with internal SQL Sid. This stays the same between both servers when migrating accounts utilizing sp_help_revlogin. Lookat: http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_25193164.html

Regards Marten
Random Solutions  
 
programming4us programming4us