Restore sql user and permission after Db restore

  • There is always a need to sync the non production environment with the production environment before any migration (code deployment) in non production environment. Example we need to restore db from Prod to Dev.I know how to script the sql users in dev database before the database gets refreshed, but how do I map the permissions back as it used to be in Dev after the db restore from Prod and drop any login's that were not in Dev before the restore.

    How can I do this, as Im spending a lot of time each time there is database restore request to manually ensure all permission are the same before and after the restore. But there has to be a better way of doing this.

  • hopefully this thread will help

    http://www.sqlservercentral.com/Forums/Topic1156166-146-2.aspx#bm1158118

    ---------------------------------------------------------------------

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply