?
Solved

SQLCMD connection to a db fails

Posted on 2006-11-30
5
Medium Priority
?
1,517 Views
Last Modified: 2006-12-01
When I attempt to connect to a DB through SQLCMD, while local to the SQL Server, the following command string produces the following error:

THIS COMMAND:
sqlcmd -l 90 -S SMSSERVER\SMS_C39 -U administrator -P password

PRODUCES THIS MESSAGE:
HResult 0xFFFFFFFF, Level 16, State 1
SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi
shing a connection to the server. When connecting to SQL Server 2005, this failu
re may be caused by the fact that under the default settings SQL Server does not
 allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

What do you suggest I try differently?

Since the DBNAME and Instance Name are two different things, should I specifying an Instance Name instead? If so, where do I find that name? I only see DBs listed.
0
Comment
Question by:johndarby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 29

Expert Comment

by:Nightman
ID: 18049789
Is administrator a domain/machine account, or an SQL login?
0
 
LVL 1

Author Comment

by:johndarby
ID: 18049939
Local account. However, I just tried to run the Update Advisor, ding the same connection and it returned a similar message. I wonder how to begin troubleshooting this? I am headed into the App Log right now.
0
 
LVL 1

Accepted Solution

by:
dmgks earned 2000 total points
ID: 18051069
Is "SMSSERVER" an alias? It appears that SQLCMD thinks it's talking to a remote server, even though you're running it on the local server. Perhaps the server name has changed since SQL was installed?

Doesn't matter. Some versions of SQL Server install out of the box with remote connections disabled. You can enable remote connections thusly:

Start / All Programs / Microsoft SQL Server 2005 / Configuration Tools / SQL Server Surface Area Configuration

Click Surface Area Configuration for Services and Connections, then click Remote Connections under Database Engine. Click the Local and Remote Connections radio button, then click Using both TCP/IP and named pipes. Bounce SQL Server and SQLCMD to your heart's content.

If it were my system, though, I'd try to figure out why SQL Server thinks "SMSSERVER" is not the name of the local SQL instance...
0
 
LVL 1

Author Comment

by:johndarby
ID: 18055388
That helped a bunch! I am brand new to SQL Server and am trying to run through as many of the basics as I can!
Thank you!
JohnD.
0
 
LVL 1

Author Comment

by:johndarby
ID: 18055391
By the way, SMSSERVER was just a faux name I used.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question