I am trying to use SQLCMD to remotely detach a database but for some reason it can't find the server. From the workstation, I can connect to the database instance (which is the default instance) using the Host Name through SSMS successfully. The error is:
TCP Provider: No such host is known. Sqlcmd: Erorr: Microsoft SQL Server Native Client 10.0 : A network-related or instance- specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
So the first thing I did was to make sure that the instance is accessible via SSMS (it is), and that my CMD prompt is Administrator (it is). Then I checked to make sure the instance has TCP enabled (it does) and allows remote connections (it does).
What am I missing? The commend I use, minus the script, is:
SQLCMD -D (database) -S TCP:(hostname) -Q (query)