Creating SQL User on Standby / Readonly 2005 DB

  • When logshipping a production database the SQL User accounts ship with when being restored. However, the SQL User SID is not the same on the two machines. With SP_DropUser and SP_AddLogin you can delete the user on the secondary DB, select the SID from the Production DB and add it in on the master DB on the secondary server. However, SP_AddLogin checks for Windows Password Policies. How can I turn off the password policy? It is only possible when using the SQL GUI to create the user.

  • Don't use sp_addlogin. It's deprecated and it doesn't have the new features (like password policies). Use CREATE LOGIN rather. In the create login statement you can specify the SID which ensures that it will match up with the user on the secondary server.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks Gail. That worked perfectly...

    Regards

    Paul

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply