Ernes
Tech
Register
Login
Jobs
Search
Articles
Videos
Shop
5
0
Home
Articles
Details
+1 (216)-435-0788
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.
What would you like to see in future on ErnesTech.com
What did you find annoying?
Was this website fast enough for you?
Yes
No
DONE
Write an Article
Views:
379
69
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
Post Comment
Upload
How to Inject Custom Http Response Header
Views
1435
How to Find Maximum Number in an Array in C#
Views
1016
Error g.cshtml.cs: The type or namespace name ErrorViewModel could not be found (are you missing a using directive or an assembly reference). File Error.g.cshtml.cs
Views
2601
Solved!! A local or parameter named cannot be declared in this scope
Views
3699
Invalid Operation Exception, the Model Item Passed In To View is of Type
Views
2420
Google
LinkedIn
Microsoft
GitHub
Google
LinkedIn
Microsoft
GitHub
Top
© 2023 - ErnesTech -
Privacy
+1 (216)-435-0788
[email protected]
English (United States)
Spanish (Spain)
French (France)
Portuguese (Brazil)
Chinese (China)
Turkish (Turkey)
German (Germany)
Jobs
Search
CRM
Articles
Videos
Shop
Contact
Sign Up
Login
Grid-Method Tools
PDF to HTML Converter
Forums