• quote:


    why not

    select * from syslogins


    syslogins doesn't contain the password. I believe you could do something like the following, but I wouldn't mess with it as long as there are easier ways.

    On source server:

    DECLARE @binpwd sysname,

    @sidid binary(16)

    select @binpwd = a.password,

    @sidid = a.sid

    from sysxlogins a,

    syslogins b

    where a.sid = b.sid

    and b.name = '[name]'

    On destination server:

    EXEC sp_addlogin '[name]',

    @passwd= @binpwd,

    @defdb = 'Master',

    @deflanguage = 'us_english',

    @sid = @binsid,

    @encryptopt = 'skip_encryption'