sqlcmd -S

  • 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?

  • 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?

  • Use--> sqlcmd -Sservername

    http://syntaxhelp.com/SQLServer/SQLCMD

  • 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?

  • Try

    sqlcmd -Sservername\instancename

    😎

    We are the pilgrims, master.
    We shall go always, a little further.
  • 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>

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply