SQL Server ships with many command prompt utilities. The command line tools are located in the c:\Program Files\Microsoft SQL Server\100\Tools\Binn directory.
Detailed information about the available tools can be found at:
We recommend using the osql utility, which allows you to enter Transact-SQL statements, system procedures, and script files. This utility uses ODBC to communicate with the server. More information about osql can be found at:
You can start the osql program from the command prompt:
The E parameter enables trusted mode using Windows authentication (you have to be logged into Windows with the proper user authorization).
The following example selects the most recent 10 records stored in the section table, which includes Verba call detail records:
SELECT TOP 10 * FROM SECTION ORDER BY start_time DESC