SQL Server Forum / General / SQL Server Tools / January 2008
SQLCMD fails with login timeout expired.
|
|
Thread rating:  |
Morris Neuman - 11 Jul 2007 23:56 GMT My system is running XP Pro ver 2002 SP2 and I have SQL2000 and SQL2005Express installed. When I run SQLCMD from a Command Prompt I get an error: Hresult 0x2, level 16, State 1 Named pipes Provider: could not open a connection to SQL Server [2]. Then a lengthy message that an error occurred and finally Sqlcmd; Error: Microsoft SQL Native Client : Login timeout expired.
I have the 2005 server management studio and see the two instances of the SQL servers and have tried it with one or the other and both servers running, all get the same message.
I am logged in to a local user account with admin privileges.
How can I correct this so I get the Sqlcmd prompt.
 Signature Thanks Morris
Peter YangMSFT] - 12 Jul 2007 06:02 GMT Hello Morris,
I understand tht you could connect to SQL Express properly by 2005 management tool but you cannot connect it via sqlcmd. If I'm off-base, please let me know.
First I'd like to know the following information before we go further:
1. By using SQL 2005 configuration manager, please check if both TCPIP and Named Pipes are enabled for SQL Express instance. Also, please make sure SQLBrowser service is running
2. In Configuration manager, please make sure TCPIP and named pipes protocals are enabled properly for SQL client.
3. Please check the errorlog for the sql express instance and make sure TCPIP and Named pipes are enabled. You shall also see the port for
C:\Program Files\Microsoft SQL Server\MSSQL.x\MSSQL\LOG
4. Try different protocols by using SQLCMD to test
sqlcmd -S np:\\127.0.0.1\pipe\MSSQL$instancename\sql\query sqlcmd -S tcp:servername\instancename sqlcmd -S tcp:servername\instancename,portnumber
Note: You may need to change the servername, instancename, portnumber properly according to your server configurations.
If you have any update, please feel free to let's know. Thank you.
Best Regards,
Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications <http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at <http://msdn.microsoft.com/subscriptions/support/default.aspx>. ==================================================
 Signature This posting is provided "AS IS" with no warranties, and confers no rights.
Morris Neuman - 12 Jul 2007 20:38 GMT Peter Thanks for your reply. I tried it with the -S np: option and that worked.
But none of the -S tcp: options worked. There I would get the error msg: "Connection string is not valid [87]." and again "login TImeout expired".
I can use it with the -np option but it would be good to know why the -tcp option fails with that msg. Any insight would be appreciated. Thank you
 Signature Thanks Morris
> Hello Morris, > [quoted text clipped - 50 lines] > ================================================== > This posting is provided "AS IS" with no warranties, and confers no rights. Peter YangMSFT] - 13 Jul 2007 04:31 GMT Hello Morris,
First I'd like to confirm the instance name of the server. Is it SQLExpress? If so, you shall use instance name 'Sqlservername\SQLEXPRESS'. Please note sqlservername shall be the compupter name of your server.
It seems that you don't have TCPIP enabled for the instance. Did you check the server confgiruation for the instance.
Also, please check the errorlog and make sure TCPIP is actually enabled:
C:\Program Files\Microsoft SQL Server\MSSQL.x\MSSQL\LOG\errorlog
For exmaple, check if there is a line like following:
2007-07-12 03:17:05.25 Server Server is listening on [ 'any' <ipv4> 3167].
Is the SQLbrowser service running properly?
If the issue still occurs, please send the errorlog to me, and please remove Online from my displayed email address.
I look forward to your update. Thank you.
Best Regards,
Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
=====================================================
 Signature This posting is provided "AS IS" with no warranties, and confers no rights.
Peter YangMSFT] - 17 Jul 2007 04:26 GMT Hello Morris,
I'm still interested in this issue. If you have any comments or questions, please feel free to let's know. We look forward to hearing from you.
Best Regards,
Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
=====================================================
 Signature This posting is provided "AS IS" with no warranties, and confers no rights.
Morris Neuman - 19 Jul 2007 15:44 GMT Besides showing the Browser Service as "Started" in the Services window how do I know it is running properly? And does that apply to both SQL 2000 and 2005?
 Signature Thanks Morris
> Hello Morris, > [quoted text clipped - 13 lines] > > This posting is provided "AS IS" with no warranties, and confers no rights. Morris Neuman - 18 Jul 2007 21:46 GMT The instance name is SQLExpress for the SQL 2005 and SQL2000MN for the SQL 2000 server (both on the same computer). I sent you an email with the logs
 Signature Thanks Morris
> Hello Morris, > [quoted text clipped - 33 lines] > > This posting is provided "AS IS" with no warranties, and confers no rights. Peter YangMSFT] - 19 Jul 2007 04:54 GMT Hello Morris,
Thank you for your reply and additional information!
From SQL 2000 error log, it's not listening on TCPIP:
2007-07-18 16:02:06.51 server SQL server listening on Shared Memory, Named Pipes.
From 2005 Express instance log, it listens on port 1900:
2007-07-18 16:06:17.62 Server Server is listening on [ 'any' <ipv4> 1900]. 2007-07-18 16:06:17.62 Server Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\SQLEXPRESS ]. 2007-07-18 16:06:17.62 Server Server named pipe provider is ready to accept connection on [ \\.\pipe\MSSQL$SQLEXPRESS\sql\query ]. 2007-07-18 16:06:17.62 Server Server is listening on [ 127.0.0.1 <ipv4> 2107].
I suggest that you try the following sqlcmd command to connect to the SQL Express instance:
sqlcmd -S tcp: DELL4600C\SQLEXPRESS, 1900
If above command works, please make sure SQL browser service is started and running properly.
Also You may want to run SQL Configuration manager if it's installed on your machine:
Under SQL native client configuration->Client Protocols, and make sure TCPIP is enabled.
Best Regards,
Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
=====================================================
 Signature This posting is provided "AS IS" with no warranties, and confers no rights.
Morris Neuman - 19 Jul 2007 15:08 GMT OK that worked for SQl2005. BTW you can't have spaces in the sqlcmd parameter so its tcp:dell4600c\sqlexpress,1900
But the ques. now is I used the SQL2000 server network utility and on the General tab there are no protocols listedin either the Disabled or Enabled protocols. I gues thats why itsnot listening on TCP. How can I fix that to get TCP listed and enabled?
 Signature Thanks Morris
> Hello Morris, > [quoted text clipped - 42 lines] > > This posting is provided "AS IS" with no warranties, and confers no rights. Rick Byham, (MSFT) - 19 Jul 2007 16:56 GMT One possibility - When you open the Server Network Utility, you may be looking at the SQL Server 2005 instance. In the Instance(s) on this server: box, select the SQL Server 2000 instance.
 Signature Rick Byham (MSFT) This posting is provided "AS IS" with no warranties, and confers no rights.
> OK that worked for SQl2005. BTW you can't have spaces in the sqlcmd > parameter so its tcp:dell4600c\sqlexpress,1900 [quoted text clipped - 53 lines] >> This posting is provided "AS IS" with no warranties, and confers no >> rights. Morris Neuman - 19 Jul 2007 18:02 GMT No Im sure I have the 2000 one selected and why would no protocols be listed then? since 2005 is listening on tcp 1900.
Im doing a reinstall of SQl2000 to see if that fixes it.
 Signature Thanks Morris
> One possibility - When you open the Server Network Utility, you may be > looking at the SQL Server 2005 instance. In the Instance(s) on this server: [quoted text clipped - 56 lines] > >> This posting is provided "AS IS" with no warranties, and confers no > >> rights. Peter YangMSFT] - 20 Jul 2007 04:51 GMT Hello Morris,
It seems some protocol related registry keys might be corrupted or missing. I agree reinstall SQL 2000 instance might be helpful. Also, I notice that you only have RTM installed, it's suggested that you upgrade to SQL 2000 SP4 to see if the issue still occurs.
http://www.microsoft.com/downloads/details.aspx?familyid=8e2dfc8d-c20e-4446- 99a9-b7f0213f8bc5
Best Regards,
Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
=====================================================
 Signature This posting is provided "AS IS" with no warranties, and confers no rights.
Peter YangMSFT] - 24 Jul 2007 04:49 GMT Hi Morris,
Any update on this issue? If you have further questions, please feel free to post back.
Best Regards,
Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
=====================================================
 Signature This posting is provided "AS IS" with no warranties, and confers no rights.
Erland Sommarskog - 12 Jul 2007 09:53 GMT > My system is running XP Pro ver 2002 SP2 and I have SQL2000 and > SQL2005Express installed. When I run SQLCMD from a Command Prompt I get [quoted text clipped - 3 lines] > Then a lengthy message that an error occurred and finally > Sqlcmd; Error: Microsoft SQL Native Client : Login timeout expired. First: when you have a problem that includs an error message, make it a habit, to *always* include the full error message. There may be information in the error message that makes it easier to resolve the issue.
> I have the 2005 server management studio and see the two instances of > the SQL servers and have tried it with one or the other and both servers > running, all get the same message. Can you or can you not connect to your SQL Server instances from Mgmt Studio?
Could you post the exact command lines for SQLCMD that you tried?
If you try to connect from Mgmt Studio, more exactly what do you? New Query from Registered Servers or something else?
Since you have SQL 2000, do you also have the SQL 2000 tools installed? Can you connect from Query Analyzre?
Your SQL 2000 instance is that a default instance or a named instance?
Have you check in SQL Configuration Manager that the client protocols match the server protocols?
 Signature Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Morris Neuman - 12 Jul 2007 20:42 GMT Erland Thank you for your response. I am able to get connected with Peter's suggestion of using -S np: option. see my response to him. I can connect with the visual tools.
 Signature Thanks Morris
> > My system is running XP Pro ver 2002 SP2 and I have SQL2000 and > > SQL2005Express installed. When I run SQLCMD from a Command Prompt I get [quoted text clipped - 27 lines] > Have you check in SQL Configuration Manager that the client protocols > match the server protocols? sachin lad - 16 Jan 2008 10:24 GMT hello to all members of this group. I am sachin lad working as a software developer in company. I am currently working in windows ce. I have some queries that while i am connecting the pda throgh my machine through wireless then i am getting some error like sql server not found. If anybody works on this type then please reply me as early as possible.
Regards, Sachin Lad Software engineer.
|
|
|