Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alifhaikal88/edaeb04c3be2c6d57ddd69157baebff9 to your computer and use it in GitHub Desktop.
Save alifhaikal88/edaeb04c3be2c6d57ddd69157baebff9 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