O'Reilly logo

SQL Server® 2008 Administration: Real World Skills for MCITP Certification and Beyond by Tom Carpenter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering SQLCMD

In Exercises 4.1, 4.2, and 4.3, you were introduced to the SQLCMD utility. This command-prompt utility is used to interact with the SQL Server. SQLCMD supports dozens of switches as shown in Figure 4.9. Pay close attention to these switches as they are case-sensitive. For example, the -S switch specifies the server to which you want to connect, but the -s switch specifies the column separator for output. As another example, the -Q switch is used to run the specified query and exit, while the -q switch runs the query and remains in the SQLCMD interactive mode prompt.

FIGURE 4.19 SQLCMD switches

image

The simplest way to use SQLCMD is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required