Tuesday, August 15, 2017

create logins in primary and secondary

 USE master --Create on primary
 go
CREATE LOGIN SQLLogin
WITH PASSWORD=P@SSWORD!'
, DEFAULT_DATABASE=[master]
GO


 SELECT name , sid
FROM sys.syslogins
ORDER BY name


 USE master --Create on primary
 go
CREATE LOGIN SQLLogin
WITH PASSWORD=P@SSWORD!'

--should get sid from primary
, SID = 0x03DA4646CC8E3D4B9327E64120DBF536
, DEFAULT_DATABASE=[master]
GO

USE the same SID AND crate ON secondary --database user permissions should replicate 

No comments:

Post a Comment

https://blog.sqlauthority.com/2009/06/27/sql-server-fix-error-17892-logon-failed-for-login-due-to-trigger-execution-changed-database-context...