Skip to content

Instantly share code, notes, and snippets.

@aturgarg
Created July 29, 2012 08:42
Show Gist options
  • Save aturgarg/3196727 to your computer and use it in GitHub Desktop.
Save aturgarg/3196727 to your computer and use it in GitHub Desktop.
SQLserver from command prompt
-- to use sqlCmd ( command line sql tool)
-- open command prompt and execute the "sqlcmd.exe" probably located at
-- "C:\Program Files\Microsoft SQL Server\100\Tools\Binn"
> sqlcmd.exe -U username -P password -S .\sqlServer
This will open sql server in cmd
1> select DB_Name()
2> Go
this will select the master DB
1> Use AdventureWorks
2> Go
Will change current Db to Adventureworks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment