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!

Default Instance Name for SQL2005

Status
Not open for further replies.

modglin

Programmer
Apr 10, 2001
105
I am trying to run a dos command to populate a database in 2005. When I installed SQL2005 I took all the default prompts. I later changed the connections to Allow Remote Connections to this server.
The command that I am supposed to run is
Code:
sqlcmd -S .\%INSTANCENAME% -E -d %DBNAME% -i "%PATH%\db_create_script.sql" -b
Apparently I do not know the instancename for 2005. When I run the command
Code:
sqlcmd -S .\%local% -E -d %BCM% -i "%c:\BCMfiles%\db_create_script.sql" -b
I get an error message:
HResult 0xFFFFFFFF, Level 16, State1
SQL Network Interfaces: Error Locating Server/Instance specified [xFFFFFFFF]. Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to the SQL Server 2005, this failure 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.

Any help will be greatly appreciated!
 
Do this...

Click Start -> Run
Type Services.msc
Click OK

Scroll down to SQL Server If you installed as a named instance, then you will see:

Sql Server([!]InstanceName[/!])


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks - did that and it shows
SQL Server(MSSQLSERVER)
I tried typing part of the command
Code:
 sqlcmd -S .\%mssqlserver%
and I received the same error message as before.
 
Don't use percent symbols. Try...

sqlcmd -S (local)\mssqlserver



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
MSSQLSERVER is the default instance. Use "sqlcmd -S localhost"

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)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
none of those worked.
I had someone recommend entering
Code:
sqlcmd -S . -E and the rest of it
and leave out the localhost or whatever I was typing in for the instance. He explained the . means local. That worked. Or at least it got me past that error. Now I have to determine some permission problems that I apparently have.
 
A period is the same as localhost. When using the default instance you don't specify the servername. You can also use -S {ServerName} as well.

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)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top