Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Copy user mapping and server roles from one user login to another

$
0
0
HI All!

Below is scenario I wanted to write the script for:

I have login users JAP/abc, JAP/XYZ, JAP/tyu. (you can check it from SSMS-database server- security- login) And I have other logins like AMP/abc, AMP/XYZ, AMP/grt. I want to copy all user mapping roles and server roles for each user login from JAP/.... to AMP/..... And if user is not exist in AMP/...(like JAP/tvu not exist in AMP/... then it creates the login for that and copy user mappings and server roles.)  PLease anyone can help me ti figure out how i can do this. Please help me out with this. I would appreciate you.


Thanks,
 

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>