• pwdencrypt is not a documented feature of SQL Server (in other words, don't use it, get some real encryption).

    But hey, in anycase, it returns a varbinary result, not a nvarchar result, so mashing it into a nvarchar will probably earn  you problems.

    QA is going biserk because its expecting double-byte unicode to come out of the nvarchar column, and your pwdencrypt in nvarchar is probably a byte too long (or makes a \t), so QA is getting mixed up on where the column ends.

     

    The way around this?

    CREATE TABLE #user(users varchar(50), passw varchar(50), title varchar(50), fullname VARCHAR(50))

    insert into #user select 'stephenj','password1','ceo','James Stephen'

    SELECT * FROM #user

    alter table #user add passwbin varbinary(256)

    update #user set passwbin=pwdencrypt(passw)

    alter table #user drop column passw

    SELECT * FROM #user

    DROP table #user


    Julian Kuiters
    juliankuiters.id.au