This article describes how to transfer the logins and the passwords between instances of Microsoft SQL Server 2005,of Microsoft SQL Server 2008, and of Microsoft SQL Server 2012 on different servers.
Microsoft SQL Server provided sp_help_revlogin stored procedure which will ease this
use master go exec sp_help_revlogin