View and Edit SQL Files: MySQL Workbench, Excel, & More

Download ArticleDownload Article

Files with the .SQL extension are Structured Query Language (SQL) data files, which are used to access and modify relational databases. To quickly view or edit SQL file, you can open it in a text editor like Notepad or TextEdit. You can also open SQL files in MySQL Workbench to use MySQL's database editing tools, or import an Azure SQL database into an Excel workbook. This How.com.vn guide teaches you three easy ways to open SQL files in Windows and macOS.

Quick Ways to Open an SQL File

  • If you want to quickly view and edit an SQL file, open it in Notepad (Windows) or TextEdit (macOS)
  • Alternatively, open the MySQL Workbench app to use their helpful editing tools.
  • Or, import an Azure SQL database to an Excel workbook using the Get Data feature in Excel.
Method 1
Method 1 of 3:

Using a Text Editor

Download Article
  1. How.com.vn English: Step 1 Find and right-click the SQL file.
    This will open your right-click options on a drop-down menu.
  2. How.com.vn English: Step 2 Hover over Open with on the right-click menu.
    This will open a list of recommended applications to open this file.
    Advertisement
  3. How.com.vn English: Step 3 Select Notepad (Windows) or TextEdit (Mac).
    This will open your SQL file in your text editor. You can easily view and manually edit the SQL script in the text editor here.
    • If you don't see Notepad or TextEdit here, click Choose another app or Other at the bottom. This will open a list of all your applications.
  4. Advertisement
Method 2
Method 2 of 3:

Using MySQL Workbench

Download Article
  1. How.com.vn English: Step 1 Open the MySQL Workbench app on your computer.
    The MySQL Workbench icon looks like a dolphin in a blue square. You can find it on your Start menu on Windows or in the Applications folder on Mac.
  2. Step 2 Double-click a model or database under "MySQL Connections.
    " You'll find your available model instances here. Just double-click the one you want to use.
  3. How.com.vn English: Step 3 Click the File tab on the top-left.
    This button is in the upper-left corner of your screen. It will open a drop-down menu.
  4. How.com.vn English: Step 4 Click Open SQL Script on the File menu.
    This will open a new file navigator window, and allow you to select the SQL file you want to open.
    • Alternatively, press Ctrl+ Shift+O (Windows) or Cmd+ Shift+O (Mac) on your keyboard.
  5. How.com.vn English: Step 5 Find and click the SQL file you want to open.
    Use the file navigator window to find your SQL file, and click on its name to select the file.
  6. How.com.vn English: Step 6 Click Open on the bottom-right.
    This button is in the lower-right corner of the file navigator pop-up. It will open your SQL file's contents in the MySQL Workbench app.
    • You can view and edit your SQL script here.
  7. Advertisement
Method 3
Method 3 of 3:

Import Azure SQL Data into Excel

Download Article
  1. How.com.vn English: Step 1 Open your Excel file.
    You can load your Azure SQL Database data into an existing Excel file, or start a new workbook.[1]
  2. How.com.vn English: Step 2 Navigate to the Data tab.
    Click the Data tab or press Alt+A.
  3. How.com.vn English: Step 3 Click Get Data.
    This is in the Get & Transform Data section.
  4. How.com.vn English: Step 4 Select From Azure in the drop-down menu.
    This will show you Azure-related data options.
  5. How.com.vn English: Step 5 Click From Azure SQL Database.
    This will open the SQL Server database dialog box.
  6. How.com.vn English: Step 6 Type the name of the server.
    Formatted the server name like this:
    • <servername>.database.windows.net
    • Replace <servername> with the name of your server.
  7. How.com.vn English: Step 7 Click Database in the left menu bar.
    The dialog box will prompt you for your server’s username and password. Enter this info into the text boxes.
  8. How.com.vn English: Step 8 Click Connect.
    This will open the data Navigator menu.
  9. How.com.vn English: Step 9 Load your data.
    This will create the connection between your Azure SQL Database and your Excel workbook.
    • Choose a database on the left side of the Navigator menu.
    • Click the tables or view you need for your work.
    • Click Load to load the selected data into Excel.
    • You’re done! Try exploring other Navigator menu options like Load to, which allows you to choose how you want to see the data in your workbook.
  10. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      How.com.vn English: Kyle Smith
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Kyle Smith. Kyle Smith is a How.com.vn Technology Writer, learning and sharing information about the latest technology. He has presented his research at multiple engineering conferences and is the writer and editor of hundreds of online electronics repair guides. Kyle received a BS in Industrial Engineering from Cal Poly, San Luis Obispo. This article has been viewed 241,394 times.
      How helpful is this?
      Co-authors: 6
      Updated: April 12, 2024
      Views: 241,394
      Categories: File Manipulation
      Article SummaryX

      1. Open MySQL Workbench.
      2. Double-click a model under "MySQL Connections."
      3. Click File on the top-left.
      4. Click Open SQL Script.
      5. Select your SQL file.
      6. Click Open.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 241,394 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement