RE: Trying to install the northwind database but run into problem



try ..

sqlcmd -S SERVERNAME -E -d DBNAME -i C:\itowww.sql (windows authentication)

sqlcmd -U USERNAME -P Password -S SERVERNAME -E -d DBNAME -i C:\itowww.sql
(SQL authentication)

Thanks!

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005


"TonyJ" wrote:

Hello!

I have found a document that says run from command line
osql -U sa -i [password] -i instnwnd.sql

This file instnwnd.sql exist from where I execute the osql/sqlcmd command

When I do so I get this error
"C:\Program\Microsoft Visual Studio .NET
03\SDK\v1.1\Samples\Setup>osql -U sa
-P [sa] -i instnwnd.sql
[SQL Native Client]Named Pipes Provider: Could not open a connection to SQL
Server [2].
[SQL Native Client]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 be caused
by
the fact that under the default settings SQL Server does not allow remote
connections."

I can also read that osql does not support all feture of SQL Sever 2005
Use instead sqlcmd. I then tried with sqlcmd but this give this error
"C:\SQL Server 2000 Sample Databases>sqlcmd -U sa -P [sa] -i instnwnd.sql
HResult 0x2, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [2].
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".

I found that error HResult 0x2, Level 16, State 1
depends on TCP/IP is not enabled.
I set TCP/IP enabled and shared memory and names pipes. I have also
restarted the sql server but I
still get the same error.

Have you out there any suggestion

//Tony



.



Relevant Pages

  • RE: Shared Memory Provider error
    ... I tried the lpc sqlcmd and indeed got an error: ... Shared Memory Provider: The Shared Memory dll used to connect to SQL Server ... An error has occurred while establishing a connection to the server. ...
    (microsoft.public.sqlserver.connect)
  • Re: Increase Connection Command timeout globally
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... As far as the database connection timing out, if you have a lot of users ... The command ... would justify increasing the command timeout. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Error "SQL Server does not allow remote connections"
    ... The application could not connect to the sql server db. ... network is blocking the connection. ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 ... integratedSecurity, SqlConnection owningObject) +737554 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Using SQLCMD to test Connection
    ... Assuming you really execute the batch file from the operating system command interpreter, then you should now have some other error compared to the one you posted earlier. ... Above is because you are connected to SQL Server from SSMS, and SQL Server expects a SQL command. ... SQLCMD is not a SQL command, ...
    (microsoft.public.sqlserver.clients)
  • RE: Increase Connection Command timeout globally
    ... As far as the database connection timing out, if you have a lot of users you ... timeout is a SQL Server or possibly a networkproblem. ... Increasing the command ... would justify increasing the command timeout. ...
    (microsoft.public.dotnet.framework.adonet)

Loading