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:
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
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
Create and Edit an SQL Query
After creating a new query, there opens an SQL Editor.
Click the icon to open Visual Query Builder:
Within the SQL Editor, you can use the following options:
Comment selected rows in a query
Open a list of options to use in a query
Format text according to the SQL standards
Insert custom parameter to a query
Insert Macro:
Linked to - shows to which entities the SQL can be applied:
When you open a corresponding grid or tool, linked SQL queries will be displayed in the Custom SQL drop-down:
SQL Help - open documentation :
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:
View Logs on the Executed Query
To view the log of the executed command and possible errors, open the Logs tab:
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
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