Using the Command-line Tools

The graphical administration tools provide just about everything you need to work with SQL Server. Still, there are times when you may want to work from the command line, especially if you want to automate installation, administration, or maintenance with scripts. The primary command-line tool is SQLCMD.EXE, which replaces OSQL.EXE and ISQL.EXE. Another command-line tool you’ ll use is BCP.EXE.

SQLCMD

SQLCMD is a SQL query tool that you can run from the command line. Unlike OSQL and ISQL, which SQLCMD replaces, SQLCMD communicates with SQL Server only through the OLE DB API. Like OSQL and ISQL, SQLCMD has very little overhead, making it a good choice when system resources are a concern. Example 1-1 shows the syntax for ...

Get Microsoft® SQL Server™ 2005 Administrator's Pocket Consultant now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.