Thursday, November 13, 2014

HResult 0x57 Level 16 State 1

HResult 0x57     Level 16     State 1
SQL Server Network Interfaces: Connection string is not valid [87].       
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.

When running sqlcmd on the local machine where SQL server is installed and in the command if we use  sqlcmd –S SERVERNAME\SQLINSTANCE –i C:\filepath\sqlquery.sql we get above error.

To resolve the problem change command line to;
sqlcmd –S localhost –i C:\filepath\sqlquery.sql

Make sure -S is in uppercase and -i is in lowercase.

No comments:

Post a Comment