Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

What is the SQLCMD tool used for?

In this expert response, SQL Server 2005 expert discusses SQL Server 2005's command-line query tool.

What is the SQLCMD tool used for?
SQLCMD is the SQL Server 2005's command-line query tool. It replaces the older isql and osql command-line tools, both of which are deprecated. isql is no longer shipped with SQL Server, and osql is scheduled for future removal from the product. Organizations using ISQL in SQL Server 7 or 2000 should switch to osql before upgrading to SQL Server 2005. After upgrading, try to switch to SQLCMD as soon as possible in order to avoid future problems.

SQLCMD provides a large number of scripting options that allow for a great amount of flexibility for dynamically running scripts. For instance, scripting variables can be embedded in scripts, which can be used as substitution parameters at runtime, thereby allowing generic database scripts to be written for large installations.

There is not enough space here to properly cover this tool; please consult SQL Server 2005 Books Online for a complete rundown.

Do you have comments on this Ask the Expert Q&A?

Dig Deeper on Microsoft SQL Server 2005

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.