Ernes
Tech
Register
Login
Jobs
Search
News
Articles
Videos
Shop
Home
Articles
Details
+1 (216)-435-0788
Join the Community
Connect to Database Using CMD
Sometimes it serves a lot of time to just connect to the database using the command prompt, its easy, reliable and fast.
In this section, I will outline how to connect to an instance of SQL server and get access to databases on your local machine:
Open up a command prompt
type: sqlcmd
On the same line, type: -S(ServerName\SqlInstanceName)
Then you can query: Select * from sys.databases
On the next line: Type Go
If successfully connected, all the databases will display
Then go ahead and choose which database to use by typing:
Use "your database"
On the next line:
If you are using T-sql just to show the tables in that database just type:
sp_tables "DatabaseName" (without quotation marks)
On the next line, type 'Go' and enter
All the tables should display then use the tables you want to query the data. Have fun.
Write an Article
Views:
379
66
Notify Me of New Posts
×
We Recieved Your Request. Thank you.
We'll never share your email with anyone else.
Submit
You Liked This Article
No Login Required!
If you log in, you will be notified when someone leaves a comment.
Other users would like to know if this solution helped you.
Post Comment
Login With Google
Login With LinkedIn
Login With Microsoft
Login With GitHub
Top
© 2023 - ErnesTech LLC-
Privacy
+1 (216)-435-0788
English (United States)
Spanish (Spain)
French (France)
Portuguese (Brazil)
Chinese (China)
Turkish (Turkey)
German (Germany)
Jobs
Search
News
Articles
Videos
Shop
Contact
Sign Up
Login
Grid-Method Tools
PDF to HTML Converter
Forums
How Can We Improve this Site?
2 + 4 =
Submit