create table tempdb..passwords( pwd varchar(255) ) 
create table tempdb..foo( pwd varchar(255),name varchar(255) ) 
insert into  tempdb..foo 
select name, pwd from tempdb..passwords inner join sysxlogins on (pwdcompare( pwd, sysxlogins.password, 0 ) = 1) union select name, name from sysxlogins where (pwdcompare( name, sysxlogins.password, 0 ) = 1) union select sysxlogins.name, null from sysxlogins join syslogins on sysxlogins.sid=syslogins.sid where sysxlogins.password is null and syslogins.isntgroup=0 --and syslogins.isntuser=0 
begin declare @ret varchar(8000) set @ret='' select @ret=@ret+'~~~~~'+tempdb..foo.name+'/'+tempdb..foo.pwd from tempdb..foo where tempdb..foo.name>@ret select @ret as ret  end

drop table tempdb..passwords
drop table tempdb..foo