>NULL: September 2019

Thursday 5 September 2019

Creating a SQL user on a SQL server set up for Secondary log shipping

Create the SQL user on the Primary SQL server and assign User Mapping, allow log shipping to occur.

On the Primary SQL server run the following, it will return a SID...
select name, sid from master..syslogins where name in ('SQLUser')

On the Secondary SQL server run the following using the SID generated on the Primary SQL server.
sp_addlogin 'SQLUser', @passwd='SQLUserPassword', @sid=0x01234567890123456789012345678901

You will now see the same user with the same User Mapping on both Primary and Secondary SQL servers, the user on the secondary will match to the permissions of the Primary server user.