SQL Server transactional replication process and error I need to setup a replication. 


Which replication is better if I want to keep my data updated in the second server as soon as new data is pushed into the primary server.
I tried setting up by clicking on New Publication and got error message:-




So I found I need to use sp_addserver. How does it work, In which table it will add the server name. How will it affect my current setup if I change the server name. Will my APIs or other services connected to this server will start failing if I chnage the server name.


A step by step guide for whole replication setup with details would be helpful.
Possible cause might be :

This error has been observed on a server that had been renamed after the original installation of SQL Server, and where the SQL Server configuration function ‘@@SERVERNAME’ still returned the original name of the server. This can be confirmed by:

select @@SERVERNAME
 go

This should return the name of the server. If it does not then follow the procedure below to correct it.

Please check these links below :

https://stackoverflow.com/questions/8212032/sql-server-replication-requires-the-actual-server-name-to-make-a-connection-to-t

http://www.cryer.co.uk/brian/sqlserver/replication_requires_actual_server_name.htm

http://blog.sqlauthority.com/2015/09/18/sql-server-fix-replication-error-sql-server-replication-requires-the-actual-server-name-to-make-a-connection-to-the-server/

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/a4d1d008-05f5-46f2-a145-347cbf4d9e5c/sql-server-replication-requires-the-actual-server-name-to-make-a-connection-to-the-server-specify?forum=sqlreplication