How do you set up linked servers in your QA environment? You set them up the same as you do in the production environment, right? Why even ask?
Correct. There is no difference in the actual steps of setting up a linked server between your QA and prod. However, consider the following typical code fragment involving a linked server:
SELECT abc FROM NYCSQL01.inventory.dbo.my_db;
where NYCSQL01 is a linked server pointing to a production SQL Server instance, most likely also named NYCSQL01. And let's further assume that you name all your production SQL instances with the NYC prefix and all your QA instances with a QA prefix. In this case, when you test the code that includes the above fragment, you have a choice, when setting up a linked server on your QA database server, between (1) naming the linked server QASQL01, and (2) naming the linked server NYCSQL01. In the 2nd choice, you need to make sure NYCSQL01 actually points to QASQL01(assuming that QASQL01 is the QA server for NYCSQL01). For obvious reasons, the 2nd choice is much more preferable. The most important reason is that you don't need to alter your code when testing it in QA.
But it doesn't really stop there. If you want to simplify your life, you should make sure that any reference to NYCSQL01 in your QA environment actually points to QASQL01 by default instead of NYCSQL01 for at least two reasons. First, there is no business for any code/app in QA to reference a production instance such as NYCSQL01. Well, that's not 100% true. In the rare cases where you do need to reference NYCSQL01 as NYCSQL01, special arrangement should be made for that to happen (not by default). Second, linked servers are not the only things that may reference NYCSQL01. The app being tested in QA may have other components such as an SSIS package, a batch file, a connection from a piece of CLR code, and so on that may access NYCSQL01. And when the app is being tested in QA, you want those references all access QASQL01 instead without changing any of your code. One way to make this happen is to modify the hosts file in C:\Windows\system32\drivers\etc to map NYCSQL01 to the IP address of QASQL01.
Is this how you set up your QA environment?