Script : Map All Orphan Users to Logins else create login and map

Once of my customer asked for an “automated” script which would find all the users, which are not mapped to login and map them. Below is the logic which can be used. <<<<<<<<<< PLEASE READ DISCLAIMER >>>>>> If (login not exists)create login and map login with userelsemap login with user <Replace MYDB and Password as…

2