Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server

Transfer Users from One SQL Server to Another Including SID’s the Easy Way

5.00/5 (1 vote)
5 Oct 2013CPOL1 min read 8.7K  
How to transfer users from one SQL Server to another including SID's the easy way

I wrote an article regarding this one earlier, but it seems that was the hard way of doing it. See the article here, but recently I was playing with SSIS in Visual Studio and found out that there is an easy way of doing it without complicated scripting and can all be achieved in a matter of 4 easy steps.

This will be really helpful for those Mirroring a lot of databases and synchronizing their users down to SID’s and permissions. For this to happen, you need Visual Studio with Business Intelligence Project Templates attached to it. Let’s start.

1. Create an Integration Services Project

1 New Project

2. Use the Transfer Login Task

2 Transfer Login Task

3. Setup your Connection

3 Connection

4 Connection Properties

4. Set Up the Transfer Task Properties

In this section, since you are mirroring the users credentials from the database, it's best to use only “AllLoginsFromSelectedDatabases” and choose the databases you need to copy the logins from.

For Mirroring, it is important to set “CopySid” to “true” so your application will run seamlessly without encountering an access denied issue as it will copy the users exactly as it is on the main SQL Server.

5 Transfer Properties

See it's really easy, why haven’t I used it like this before?

Filed under: CodeProject, Servers, Tips Tagged: SQL Server, SSIS

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)