--Server1
create database OrphanDemo
create login Vijay with password='Hyd@1234'
go
use OrphanDemo
go
create user Vijay for login Vijay
go
grant select to Vijay --db level
--Backup of database and restore
backup database OrphanDemo to disk='d:\backups20\Orp.bak'
--Server2
--Restoring database
--Take new query on the database
use OrphanDemo
go
sp_change_users_login 'report'
--option1
create login Vijay with password='Hyd@1234'
--Updating SIDs
sp_change_users_login 'update_one',Vijay,Vijay
--Connect to Server2 with Vijay and try to access OraphanDemo
--option2: Transferring login from Server1 with SID and pwd
--Go to Server1 and run the following command
sp_help_revlogin Vijay
--Copy output and run in Server2 and Connect server2 with Vijay