views:

1682

answers:

2

I am interested in using some kind of a command-line utility for SQL Server similar to Oracle's SQL*Plus. SQL Server seems to have several options: osql, isql, and sqlcmd. However, I am not quite certain which one to use.

Do they all essentially do the same thing? Are there any situations where it is preferable to use one over the others?

+7  A: 

Use sqlcmd-- it's the most fully featured product.

  • sqlcmd: The newest, fanciest command-line interface to SQL Server.
  • isql : The older, DB-Library (native SQL Server protocol) way of command-line communication with SQL Server.
  • osql : The older, ODBC-based way of command-line communication with SQL Server.
Dave Markle
+3  A: 

I'm not sure what the scope of your question is, but I believe :

isql used DB-Library to communicate to the server and is no longer included after SQL2000

osql used ODBC to communicate to the server and will no longer included after SQL2005

sqlcmd used OLE DB to communicate to the server and is currently the recommended command line tool.

John MacIntyre