Link to home
Start Free TrialLog in
Avatar of andieje
andieje

asked on

problem with sqlcmd

hi

on my machine at home i can run this command without problem

sqlcmd -S UCHOOSEWEB\SQLEXPRESS -i C:\TRANSFORMTVDATA.SQL -O C:\OUT.TXT

a console window appears and displays messages such as 'changing database context" and '-o is obsolete' and the sql in the file is executed

if i run the same command on my web server a console window opens and the closes immediately. It seems like there is something wrong with the sqlcmd on the web server. Naturally i am using the appropriate machine names on the different computers.

If i type sqlcmd -S UCHOOSEWEB\SQLEXPRESS a console window opens with '>1' as a prompt.

why cant i run the command on the web server?

thanks a lot
andrea

thanks
andrea
ASKER CERTIFIED SOLUTION
Avatar of devsolns
devsolns

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andieje
andieje

ASKER

Hi

I mustn't have explained very well as that is not the problem. However, I've been investigating further and found a new error. Ii type this at the command line i get this error

C:\Documents and Settings\Administrator>sqlcmd -s uchooseweb\sqlexpress

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.

why is it trying to open a remote connection?
Avatar of andieje

ASKER

hi. i had typed it wrong :(

so if at cmd prompt i type

sqlcmd -s uchooseweb\sqlexpress i get a window opening with the 1> prompt. all good

however if i type

sqlcmd -S UCHOOSEWEB\SQLEXPRESS -i C:\TRANSFORMTVDATA.SQL -O C:\OUT.TXT

it does not run the sql file
Avatar of andieje

ASKER

oh what do you know. someone had deleted the file. marvellous
Glad you fixed it!