Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

sqlcmd error - HResult 0xFFFFFFFF, Level 16, State 1 Expand / Collapse
Author
Message
Posted Wednesday, October 30, 2013 12:06 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, May 15, 2014 8:51 PM
Points: 183, Visits: 480
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. 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.


Post #1509905
Posted Wednesday, October 30, 2013 2:17 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, September 19, 2014 1:36 PM
Points: 2,871, Visits: 3,060
You need to specify the remote server name. The code you are using is trying to connect to the named instance MYSQLSERVER2008 on the local host "sqlcmd -S .\MYSQLSERVER2008". It should look like this "sqlcmd -S RemoteServer\MYSQLSERVER2008"
Post #1509938
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse