I am trying dynamically build an SQL Statement that includes linked server. That works. When I use "localhost" to reference the current local machine SQL Server, that doesn't work.
Select * From [LOCALHOST\SQLEXPRESS].[My_Database].[dbo].[My_Table]
However, if I specify my machine name instead, it will work.
Select * From [My_Machine\SQLEXPRESS].[My_Database].[dbo].[My_Table]
Why can't I reference Localhost?