1. Computing & Technology

Discuss in my forum

SQLCMD Step-by-Step

By , About.com Guide

Connecting to the Database
SQLCMD Step-by-Step Mike Chapple
Once you have a command prompt open, you use the SQLCMD utility to connect to the database. In this example, we're connecting to the AdventureWorks2008 database, so we use the command:

sqlcmd -d AdventureWorks2008
This uses the default Windows credentials to connect to your database. You may also specify a username using the -U flag and a password using the -P flag. For example, I could connect to the database using the username "mike" and password "goirish" with the following command line:

sqlcmd -U mike -P goirish -d AdventureWorks2008

©2012 About.com. All rights reserved.

A part of The New York Times Company.