2

I am trying make to make a remote SQL server execute a small .sql file (for now. later, i will try a huge 200 mb.sql file) using sqlcmd (on my client computer). I can easily connect to my server via management studio. But, I get an error when I try to connect via sqlcmd.exe instead. I can access the server using sqlcmd - I get the > command prompt.

my command is of the form -

sqlcmd -S .\MYSQLSERVER2008 -U MyUsername -P MyPassword -i C:\Database\hugescript.sql

This causes an error -

HResult 0xFFFFFFFF, Level 16, State 1
SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].

Sqlcmd : error : 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..
Sqlcmd : error : Microsoft SQL Server Native Client 10.0 : Login timeout expired

Solutions that did not work -

How to connect Sqlcmd to the server?

http://blogs.msdn.com/b/spike/archive/2010/06/21/quot-error-locating-server-instance-specified-xffffffff-quot-sqlsrv32-to-the-rescue.aspx

I tried his add a odbc dsn thing. But, I still get the same error. I am going to try more google searches. But, if anyone knows how to fix this, please help me. Thanks.

5
  • 1
    this also does not work - sqlteam.com/forums/topic.asp?TOPIC_ID=102937
    – Steam
    Commented Oct 30, 2013 at 18:40
  • 1
    Is it remote instance or local instance ? In your question it says it is remote instance but your command is for local instance. If it is remote instance you need to specify server name as well.
    – JackLock
    Commented Oct 30, 2013 at 19:52
  • @JackLock - The instance is remote. How do I get the name/IP of the server on which it is installed ?
    – Steam
    Commented Oct 30, 2013 at 19:57
  • 1
    You were able to connect to that instance in SSMS, correct ? You need to use same name that you used in "Server Name" for SSMS.
    – JackLock
    Commented Oct 30, 2013 at 20:00
  • 1
    @JackLock - I don't understand this instance vs server thing correctly. Server is a physical computer/VM on which instances are installed ? These instances are called "server name" in management studio ?
    – Steam
    Commented Oct 30, 2013 at 20:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.