how to store DB roles before restoring db

  • Hi guys

    is there anyway we can script out or store the database roles and permission before we restore that DB.

    If anyone can help me out with this

    Thanks And Happy Fri

  • If you create the logins with the right SID then you will not have a problem with permissions and roles when restoring the DB.

    You can get the SID from sysusers.

    SELECT @sid

    FROM SysUsers

    WHERE Name=<Login Name>

    Keep in mind that the Windows authentication user will not have a DB SID

    -Roy

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

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