Create login in log shipping secondary

Já precisou criar um login em uma database secundária de Log Shipping?

É simples.

Execute a consulta abaixo no servidor primário do Log Shipping e copie o valor do campo sid.

select name, sid from master..syslogins where name in ('loginUsername')

Execute o comando abaixo no servidor secundário do Log Shipping preenchendo o valor da variável @sid com o conteúdo copiado na consulta anterior:


exec sp_addlogin 'loginUsername', @passwd='loginPassword', @sid=0xC8F35F87336B2D49AA7900EED64D83FE

Referências:

https://support.microsoft.com/en-us/help/303722/how-to-grant-access-to-sql-logins-on-a-standby-database-when-the-guest

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s