Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

sqlcmd -S Expand / Collapse
Author
Message
Posted Thursday, May 27, 2010 3:11 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Today @ 11:42 AM
Points: 754, Visits: 1,073
Hi,

i try to execute this command at the cmd level:

sqlcmd -S computername


i receive the following error:

invalid comand line arg[2]: '-S'


My instance name the name of my computer.

Why does this fails?
Post #928826
Posted Thursday, May 27, 2010 3:49 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Today @ 11:42 AM
Points: 754, Visits: 1,073
It as any thing to do with the fact that i have a SQL Server 2000 named instance on the same box?

I can connect using osql, but can not connect using sqlcmd...


osql was finished in SQL Server 2005, correct?
Post #928847
Posted Thursday, May 27, 2010 1:02 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, May 22, 2014 7:04 AM
Points: 1,688, Visits: 8,766
Use--> sqlcmd -Sservername

http://syntaxhelp.com/SQLServer/SQLCMD
Post #929235
Posted Friday, May 28, 2010 1:08 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Today @ 11:42 AM
Points: 754, Visits: 1,073
It does not work...

Maybe it's because i have my default instance in SQL Server 2005 and my named instance in SQL Server 2000.

Maybe i have to change the order as the instances are installed and put the default instance as SQL Server 2000.


What do you think?


I can connect to SQL Server 2005 using oSQL instead of sqlcmd, isn't this strange?
Post #929486
Posted Monday, August 23, 2010 1:45 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 1:39 AM
Points: 210, Visits: 308

Try
sqlcmd -Sservername\instancename



We are the pilgrims, master.
We shall go always, a little further.
Post #973244
Posted Monday, August 23, 2010 2:18 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, May 2, 2014 10:10 AM
Points: 26, Visits: 327
Can you supply the servername and the instance name if it is not the default instance on the server. This will help us format the SQLCMD parameters you should be using.

Generally when I have used it is has been:

sqlcmd -H<Host name if on different machine> -S<SQL server name\instance name> -U<username if needed> -P<password> -E -i<input file for execution> -o<output file for results>

Post #973261
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse