SQL Server Performance Forum – Threads Archive
Script to map logins and users of all db on serverHi!
Can You suggest me any script which will function as sp_change_users_login for all the dbs on the server at a time as well as map the sid of login and user.This I need to make the current server exactly like old server.I dont want to leave any stones unturned
Check: http://www.sqlservercentral.com/scr…rynm=Maintenance and Management &categoryid=1 Luis Martin
SQL-Server-Performance.com One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important
All postings are provided â€œAS ISâ€ with no warranties for accuracy.
Think I answered this already in another post. In the following post you will find the needed scripts:
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=4529 there is a script called sp_fixusers. Create that SP in the master database then run: –Sync logins in All Databases – custom SP
SELECT ‘Use ‘ + Name + ‘
G’ + ‘O ‘
WHERE DBID > 4
Order By Name This will gerneate the needed code to update all logins on all databases like this:
GO Use UserDBName2
… Argyle… post this on the tips section.. if you could. Satya SKJ
This posting is provided â€œAS ISâ€ with no rights for the sake of knowledge sharing.