This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
SQL/BSERP2-3-E3 用户密码解密脚本(1).sql
T
2025-02-08 12:27:37 +08:00

35 lines
854 B
Transact-SQL

---BSERP2/3/E3 用户密码解密
if exists(select 1 from sysobjects where name='fn_bsuser_pwdjm' and xtype='fn')
drop function fn_bsuser_pwdjm
go
create function fn_bsuser_pwdjm(@pwd varchar(200))
---BSERP2/3/E3 用户密码解密
returns varchar(200)
as
begin
declare @Y varchar(200)='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',
@J varchar(200)='qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM9147038562',
@i int=0,
@num int,
@result varchar(200)=''
while @i<len(@pwd)
begin
set @num = charindex(substring(@pwd,@i+1,1),@J)
if @num >0
set @result = @result+substring(@Y,charindex(substring(@pwd,@i+1,1),@J),1)
else
set @result = @result+substring(@pwd,@i+1,1)
set @i+=1
end
return(@result)
end
go
select userid,name,dbo.fn_bsuser_pwdjm(PASSWORD) from bsuser