Showing posts with label HeidiSQL. Show all posts
Showing posts with label HeidiSQL. Show all posts

Thursday, November 26, 2015

How do you run a simple query in HeidiSQL?

It is really no different from running a query in SQL Server Management Studio. You need to have an instance of SQL Server running on your computer. Launch HeidiSQL and get connected to the instance.

You will be seeing this (different in your case) displayed in the HeidiSQL user interface. Either you can get connected to a session you created or a new one using the New button at the bottom of the UI.
 
RunAQuery01.png

You can connect to a single database by selecting it from the list as shown. Here Northwind was selected.

RunAQuery02.png
The Nov21 sessions gets changed and the changed sessions window opens as shown:


RunAQuery03.png

Click on Query to open a window for inserting query related statements as shown:
RunAQuery04.png

In the Query Window insert your SQL statement. For example a query such as the one shown:

SELECT TOP 50 [CategoryName]
      ,[ProductName]
      ,[ProductSales]
  FROM [Northwind].[dbo].[Product Sales for 1997]


 

Click Query and the response will appear below the query window as shown.

 
RunAQuery07.png

The tabbed window in the center has all the necessary tabs like the SAP SQLAnywhere Studio Central.

Saturday, November 21, 2015

How do you connect to SQL Server 2012 using HeidiSQL?

 HeidiSQL is a client application and you can use it to work with databases. If you want to know more about it, or download and install HeidiSQL go here.

Launch HeidiSQL from your desktop or click the HeidiSQL app from the All Apps menu shown.



The Heidi Session Manager is launched as shown.

 
Heidi_Session_00.png

Click New and choose Session in root folder from the drop-down list as shown.


Heidi_Session_01.png

You can change the session name by over-writing as shown. Herein it is Nov21.

Heidi_Session_02.png

By default the connection is to MySQL using TCP/IP and localhost(127.0.0.1)

Let us change the Network type to Microsoft SQL Server using TCP/IP by using the drop-down menu shown.

Heidi_Session_03.png

Choose Windows authentication as shown.

Heidi_Session_04.png

Click Open. The connection is refused.

 Heidi_Session_05.png

OK. Let us look if the SQL Server has started. Open the Control Panel|...|Services and verify that the server has started. Indeed it is running (option chosen at SQL Server Installation).


Heidi_Session_06.png

Now let us change the Hostname /IP to Hodentek8\RegencyPark (over write 127.0.0.1)
Click Open after changing the hostname.
 You may get a save modifications message.

 
Heidi_Session_07.png


Click Yes. The program processes this information and the client is now connected to the named instance of SQL Server 2012 as shown.


Heidi_Session_08.png

Now you are cooking!




What is HeidiSQL?

It is a client tool used by web developers for working with MySQL Server, Microsoft SQL databases and PostgreSQL. It is free, Open Source since 9 years of active development and very useful.

What all HeidiSQL can do?

HeidiSQL which is a client application can carry out a lot of data related tasks:
•Connect to multiple servers in one window
•Connect to servers via command line
•Connect via SSH tunnel, or pass SSL settings
•Create and edit tables, views, stored routines, triggers and scheduled events.
•Generate nice SQL-exports, compress these afterwards, or put them on the clipboard.
•Export from one server/database directly to another server/database
•Manage user-privileges
•Import text-files
•Export table rows as CSV, HTML, XML, SQL, LaTeX, Wiki Markup and PHP Array
•Browse and edit table-data using a comfortable grid
•Bulk edit tables (move to db, change engine, collation etc.)
•Batch-insert ascii or binary files into tables
•Write queries with customizable syntax-highlighting and code-completion
•Pretty reformat disordered SQL
•Monitor and kill client-processes
•Find specific text in all tables of all databases of one server
•Optimize and repair tables in a batch manner
•Launch a parallel mysql.exe command line window using your current connection settings

Where do you install HeidiSQL?

Download the HeidiSQL 9.3 Installer here. There are other options as well. Double clicking the executable begins the installation.
Here are some screen shots.



 Agree to license terms and click Next.

 Accept default folder.

Chose not to associate for now.

 Done!
 Launches HeidiSQL Session if the checkbox is checked.

 Leaves a new app on All Apps in Windows 10


It also enters the Programs and Features list in Control Panel.