You could modify the following code to work (only if you are using SQL authentication). I think this came from sqlmag. This keeps the same GUID and password on both hosts. Pretty useful really.The output is a little ugly, but it works.SET NOCOUNT ONSELECT 'EXEC sp_addlogin @loginame = ''' + loginname + '''',', @defdb = ''' + dbname + '''',', @deflanguage = ''' + language + '''',', @encryptopt = ''skip_encryption''',', @passwd =', cast(password AS varbinary(256)),', @sid =', sidFROM sysloginsWHERE name NOT IN ('sa')AND isntname = 0-ec