2.9. sqlcmd

You won't see sqlcmd in your SQL Server program group. Indeed, it's amazing how many people don't even know that this utility (or its older brothers — osql and isql) is around; that's because it's a console rather than a Windows program.

There are occasionally items that you want to script into a larger command-line process. sqlcmd gives you that capability. sqlcmd can be very handy — particularly if you make use of files that contain the scripts you want to run under sqlcmd. Keep in mind, however, that there are usually tools that can do what you're after from sqlcmd much more effectively, and with a user interface that is more consistent with the other things you're doing with your SQL Server.

Once again, for history and being able to understand if people you talk SQL Server with use a different lingo, sqlcmd is yet another new name for this tool of many names. Originally, it was referred to as ISQL. In SQL Server 2000 and 7.0, it was known as osql.

Get Professional SQL Server™ 2005 Programming 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.