Microsoft SQL Server provides users with a variety of rich graphical user interfaces to retrieve and manipulate data and configure SQL Server databases. However, sometimes it’s just easier to work from the old-fashioned command line. Whether you’re looking for a quick-and-dirty way to execute a SQL query or wish to include SQL statements in a Windows script file, SQLCMD allows you to meet your goal.
This tutorial assumes that you already have Microsoft's AdventureWorks Sample Database installed.


