SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


sqlcmd -S


sqlcmd -S

Author
Message
river1
river1
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11525 Visits: 1740
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?
river1
river1
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11525 Visits: 1740
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?
MANU-J.
MANU-J.
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17824 Visits: 8766
Use--> sqlcmd -Sservername

http://syntaxhelp.com/SQLServer/SQLCMD
river1
river1
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11525 Visits: 1740
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?
Jamie Ingram-729524
Jamie Ingram-729524
SSC Eights!
SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)

Group: General Forum Members
Points: 935 Visits: 448
Try
sqlcmd -Sservername\instancename

Cool

We are the pilgrims, master.
We shall go always, a little further.

BravehearT1326
BravehearT1326
SSC Veteran
SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)

Group: General Forum Members
Points: 226 Visits: 336
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>
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search