1、查询现有的sql server 实例中的账号信息:
select t.name,t.sid,t.password_hash
from sys.sql_logins t
where t.name not like '%MS%' --排除sa以及微软系统账号
and t.name<>'sa';
2、根据查询到的用户名、以及被hash加密后的密码字符串建立用户登录脚本并在目标sql server实例上执行,完成迁移。
CREATE LOGIN Machine WITH PASSWORD=0x02002FD8F734E6A5F0F24F7C3376FC877A810A4CA3708C63BCCD5746A38EBE398B4DB6199C746953FA1DE3E4876629441C9F6C94EB4019FA33C263081AC8A596FDC1A606281E HASHED,SID=0x02002FD8F734E6A5F0F24F7C3376FC877A810A4CA3708C63BCCD5746A38EBE398B4DB6199C746953FA1DE3E4876629441C9F6C94EB4019FA33C263081AC8A596FDC1A606281E;
CREATE LOGIN ZABBIX WITH PASSWORD=0x02008D957CD309573B871FD645A6263A3D1EB150294BD3656105111B50A582FE52DD01549923EA00F3779372A27534E459BEF7B9F77405F4BD5D22AB32F34B19085B21B237B2 HASHED,SID=0x7CAC08827FA0B942B38D514787021443;
CREATE LOGIN MAXGAUGE WITH PASSWORD=0x0200DEEC9791316683DFC2BEE00DE3B937EB5FDBC5BC40462FF52D2F824C1D5C879FFB7DD4170CC53CF193796C1C1C6A3078005E8F4DE2A09BF297F08ADCC4C5052C682C0E9F HASHED,SID=0x33CE1E8283605041AAE9680A2DDCB8E5;
标签:登录,CREATE,Sql,HASHED,Server,sql,SID,LOGIN,PASSWORD From: https://www.cnblogs.com/oradba/p/17251357.html