Displaying the SQL query for a view when previewing in Drupal 7 Views Updated on August 16, 2021 by Scott Mitchell 1 Minutes, 1 Seconds to Read When working in the Views module, you may want to preview the SQL that is generated by the view. This is for the code savvy or the ones looking to be and would like to see the SQL generated for either debugging or further development of their views. Sometimes seeing the code can help understand how the view works in case it needs further tweaking. Showing the SQL query for a View’s preview is done with the following instructions. Showing the SQL query for a view preview in Drupal 7 Views Log into your Drupal 7 admin dashboard. From the top menu bar, locate the Structure option and click it. Click on the Views option to move to the next screen. You are now on the Views list screen. Look to the upper right and you will see two tabs. Click on the one that is labeled Settings. Once you get to the Settings page scroll down to the bottom of the screen to the Live Preview Settings and find the checkbox labeled Show the SQL query. Click the checkbox to enable the feature. Once finished, click on the Save Configuration button at the bottom. Preview one of your views and you will now see the SQL code. Share this Article Related Articles Finding 404 page not found errors in Drupal 7 Removing the site title in Drupal 8 Content Types in Drupal 8 Disabling user images for posts and comments in Drupal 8 How to add an image in Drupal 7 How to upload your custom logo in your Drupal 7 theme Setting custom logos in your Drupal 8 theme Fixing the “An unrecoverable error occurred” error in Drupal How to Make a Duplicate Drupal Site How to Install a New Theme in Drupal