Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot Connect to Sql Server Express 1

Status
Not open for further replies.

jmeckley

Programmer
Jul 15, 2002
5,269
US
I'm trying to connect to the local instance of Sql Server Express which came with VS2005. from the command line I enter [tt]osql -E[/tt] and I get the follow error:
[SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2]. Login timeout expired
[SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may becaused by the fact that under the default settings SQL Server does not allow remote connections.

All configurations are running default values. SQL Server runs under the network account. NamedPipes, TCP/IP & Aliases are all disabled. Remote connections are disabled.
I tried enabling the different connection types and setting the properties (along with restarting the service) but that didn't work. The same exception was thrown. I wouldn't consider my connection to be remote because the service is on my local box and I want to create a database on the local box.

I'm doing this from the command line because I want to use the nant automated build features to build my database.

Has anybody else experienced this problem? Thank you for your assistance.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
osql is a utility for managing sql2000/msde2000. For SQL2005/Sql Express, you would be better off using sqlcmd

I recommend you try it to see if it resolves your problem. While you are at it, also try specifying the server\instance name

Ex:

sqlcmd -E -SServerName\InstanceName



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
thanks for the claification on sqlcmd vs. osql. it appears osql still works with sql. I added [tt]-S.\SQLExpress[/tt] to my script and that seems to fix the problem.

In my training class this wasn't required. For all I know there was only 1 db instance on the network, so it defaulted to that. Here at the office we have a couple of instances, so I need to specify which one to connect to.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
When Visual Studio installs SQL Express it defaults to the instance name SQLEXPRESS.

Most training centers do an advanced install (or remove and reinstall SQL Express) so that it's running as the default instance.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top