Problem:

I was getting an error when trying to configure MP database replica following directions on TechNet

http://technet.microsoft.com/en-us/library/hh846234.aspx#BKMK_DBReplica_ConfigSiteDB

 

Msg 50000, Level 16, State 1, Procedure spCreateMPReplicaPublication, Line 294
ERROR 15007, Level 16, State 1, Procedure sp_grant_publication_access, Line 109, Message: ‘sa’ is not a valid login or you do not have permission.
Msg 50000, Level 16, State 1, Procedure spRethrowError, Line 42
ERROR 15007, Level 16, State 1, Procedure sp_grant_publication_access, Line 109, Message: ‘sa’ is not a valid login or you do not have permission.

 

Solution:

The reason why this was occurring was because the SQL administrators at my organization rename and disable the SA account so when the stored procedure runs it cannot find the SA account to finish running the procedure.

 

Edit Line 237 of stored procedure to match the renamed SA account.

 

Example:

EXEC sp_grant_publication_access @publication = @PublicationName, @login = N’xsa’