Created
July 29, 2012 08:42
-
-
Save aturgarg/3196727 to your computer and use it in GitHub Desktop.
SQLserver from command prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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