Overwrite database

  • hello experts,

    it is my daily task almost, on the request of users i need to overwite datbase from production to UAT server. in that case i jst take backup from prod ans restore it to UAT wid diff name. bt main problem is i need to create all user and need to give same role according to older UAT DBase one by one.its really time taking bcouse i check around 50 users and their role one by one.

    Any suggestion?? or script to create users with their roles

  • We have this automated all over the place. You need to script out a few sets of processes. First, obviously, the database restore. Then, you need to remove production level security through a script. Then, apply the other set of security through a script.

    If you script the process out, you can make it completely repeatable, without errors, and you can maintain it over time with changes, etc.

    Also, when we do this, we have a data update process, again, scripted in, all part of a SQL Agent job, that cleans up sensitive production information so that we're not exposing stuff to developers that they shouldn't see.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • exactly, can i get script to get user of a database with their role, so that i can appy them to another database. in a single shot, it very iritating to check role every user and assign the same in another database.

  • Try using sp_help_revlogin[/url].

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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