Skip to main content
fixed formatting
Source Link
mustaccio
  • 26.9k
  • 24
  • 58
  • 74

If it is SQL Login and not Windows Login you might want to create the login (user) on the replica with the same SID, that will assure permissions are replicated as well.

CREATE LOGIN login_name WITH Password = 'strong_password', SID = 0xSome_value.

CREATE LOGIN login_name WITH Password = 'strong_password', SID = 0xSome_value

You can get the SID from the primary instance by querying table sys.server_principalssys.server_principals.

Select name, sid From sys.server_principals Where name = login_name

Select name, sid From sys.server_principals Where name = login_name 

If it is SQL Login and not Windows Login you might want to create the login (user) on the replica with the same SID, that will assure permissions are replicated as well.

CREATE LOGIN login_name WITH Password = 'strong_password', SID = 0xSome_value.

You can get the SID from the primary instance by querying table sys.server_principals.

Select name, sid From sys.server_principals Where name = login_name

If it is SQL Login and not Windows Login you might want to create the login (user) on the replica with the same SID, that will assure permissions are replicated as well.

CREATE LOGIN login_name WITH Password = 'strong_password', SID = 0xSome_value

You can get the SID from the primary instance by querying table sys.server_principals.

Select name, sid From sys.server_principals Where name = login_name 
Source Link

If it is SQL Login and not Windows Login you might want to create the login (user) on the replica with the same SID, that will assure permissions are replicated as well.

CREATE LOGIN login_name WITH Password = 'strong_password', SID = 0xSome_value.

You can get the SID from the primary instance by querying table sys.server_principals.

Select name, sid From sys.server_principals Where name = login_name