If I am planning to set up a SQL Server to replicate to a standby server at another location, and if the standby server is for failover use only, do I need to buy the same license type for both servers?
You do not need another license for a standby SQL Server, as long as it is not used by any application. You would only have to license it if you failed over to the server and kept using it for more than 30 days. Basically, after a failover, you have a 30-day window to fix your primary server and fail back.
I would, however, encourage you to consider log shipping instead of replication, since it is much easier to set up. For many reasons, log shipping is much more suitable to provide for failover on a standby server. Replication makes sense if you need to have a replica of the data available in almost real time, but you already said you don't want to use the second server unless you need to fail over. In case of a standby SQL Server, it is much easier to restore transaction logs on the standby server (the built-in log shipping wizard makes it very easy to set up) than it is to deal with all the disadvantagse and restrictions of replication.
Dig Deeper on SQL Server Replication
Related Q&A from Roman Rehak
Discover a SQL Server workaround to fix an error that pops up when trying to view a report in the Report Manager when using Reporting Services in SQL... Continue Reading
Learn how to restore a SQL Server database in VB.Net using this ADO.Net code sample provided by our expert. Continue Reading
Learn how to use BULK INSERT to import all SQL Server dataset rows to a table. Continue Reading