Monday, 6 April 2015

PERMISSIONS AFTER REFRESHING (Restoring)

Run the below script in source server database(which database you want to restore) then we will get the Stored proc of the all the permissions then run these stored proc in destination server new database.

select 'exec sp_addrolemember ' + '''' + g.name + '''' + ',' + '''' + m.name + ''''
from sys.sysmembers join sys.sysusers g on groupuid = g.uid
join sys.sysusers m on memberuid = m.uid

No comments:

Post a Comment