Solved

SQLCMD connection to a db fails

Posted on 2006-11-30
5
1,501 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
  • 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 500 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

910 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now