-->

Thursday, August 23, 2012

How-To: Copy SQL Server User Accounts From One Instance to Another

This article from Microsoft explains how to script out the logins in SQL Server on one server that you can execute onto another SQL Server.  Basically, what you are doing on the source SQL Server is creating a Stored Procedure in the Master database that will return all the logins WITH passwords in script format so that you can execute it in a Query onto the destination SQL Server.  Here is a sample of the output of the stored procedure:

-- Login: testuser
CREATE LOGIN [testuser] WITH PASSWORD = 0x0200565C53D7AE099FF88B71F1A8497B62943DF662CFDB7868EE943F2DF75BFE6249C61DDC2F4E43197991D6E617ADC2335F2C65DFB9A2A667FAE2C40C03D2A0847F66A68E HASHED, SID = 0x85VEB3BBBF2D146B272FC4E4C917512, DEFAULT_DATABASE = [master], CHECK_POLICY = ON, CHECK_EXPIRATION = ON

The article to follow is here.

No comments:

Post a Comment