Thursday, July 31, 2008

Creating same users on Different SQL Servers (SQL Server 2005)

Many times we need same users on different SQL servers. While I was setting up Database mirroring I also came across this requirement.
Here are the simplest steps to copy your SQL server users from one server to other server:

1. Download SQLServerUser.sql
2. Run it on Source SQL Server It will create a store procedure “sp_help_revlogin”
3. Execute this store procedure using following command

EXEC sp_help_revlogin

It will genrate a script to create same users in different server. Save the output script in .sql file and run it on destination servers.

No comments: