7.2. Custom SQL

The Custom SQL tool allows you to create SQL queries and upload queries from the file.

Examples of tasks you can perform via SQL queries:

  • increase quantities for products of a specific manufacturer;

  • remove discounts that were previously applied to particular items.

Custom SQL tool is available with the PRO Edition of Store Manager for Magento.

In the Standart Edition, the Custom SQL section will be disabled. To use this tool, you will need to upgrade to the PRO Edition. Compare the Store Manager for Magento Plans & Pricing

Note: To use the tool, you must have extensive knowledge of building SQL queries.

SQL Editor Options

To open a custom SQL editor, click Tools > Custom SQL:

Magento Store Manager Custom SQL Button

To create a query, press [New]. This and other queries that you create will be displayed in the left pane.


You can perform the following actions over queries:

  • Rename - change the name of a selected query

  • Delete - remove selected query

Magento Store Manager Custom SQL Left Panel
  • Open an SQL from a file

  • Save SQL query to a file

  • Execute SQL - run the selected query

  • Execute selected only - run selected part of a query

Magento Store Manager Custom SQL Execute SQL

Create and Edit an SQL Query

After creating a new query, there opens an SQL Editor.

Magento Store Manager Custom SQL Editor
Magento Store Manager Custom SQL Open Visual Query Builder Icon

Click the icon to open Visual Query Builder:


Magento Store Manager Custom SQL Visual Query Builder

Within the SQL Editor, you can use the following options:

Magento Store Manager Custom SQL Add Comment Icon
  • Comment selected rows in a query

Magento Store Manager Custom SQL Select Function
  • Open a list of options to use in a query

Magento Store Manager Custom SQL Select Option for Query
Magento Store Manager Custom SQL Format SQL Text
  • Format text according to the SQL standards

Magento Store Manager Custom SQL Insert Custom Parameter
  • Insert custom parameter to a query

Magento Store Manager Custom SQL Insert Custom Parameter
Magento Store Manager Custom SQL Insert Macro
  • Insert Macro:

Magento Store Manager Custom SQL Insert Macro
  • Linked to - shows to which entities the SQL can be applied:

Magento Store Manager Custom SQL Linked SQL to Entity

When you open a corresponding grid or tool, linked SQL queries will be displayed in the Custom SQL drop-down:

Magento Store Manager Custom SQL Select SQL in Product Grid
Magento Store Manager Custom SQL Help Button
  • SQL Help - open documentation :

Magento Store Manager Custom SQL Help Window

View and Export Results of Executed Query

After query execution, you can view the result in the Results tab.

To export data from the Results tab, click Export grid and select the file format:

Magento Store Manager Custom SQL Preview Query Result

View Logs on the Executed Query

To view the log of the executed command and possible errors, open the Logs tab:

Magento Store Manager Custom SQL Preview Query Logs

How to add an SQL Query From a File

1. Press the folder icon and locate an SQL file on your computer. Press [OK] to upload the file to the SQL Editor.


2. An alternative method is to copy an SQL file to the folder with Store Manager files:

C:\Users\...\AppData\Local\eMagicOne Store Manager for Magento\Custom_SQL

Magento Store Manager Custom SQL Copy/Paste Query

Do you need help or want to order the development of a query for your specific task? Send your request here: https://support.emagicone.com/submit_ticket