View and Edit SQL Files: MySQL Workbench, Excel, & More
View and Edit SQL Files: MySQL Workbench, Excel, & More
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 wikiHow guide teaches you three easy ways to open SQL files in Windows and macOS.
Quick Ways to Open an SQL File

Using a Text Editor

Find and right-click the SQL file. This will open your right-click options on a drop-down menu.

Hover over Open with on the right-click menu. This will open a list of recommended applications to open this file.

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.

Using MySQL Workbench

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. If you don't have MySQL Workbench installed on your computer, you can select your system, and download the app installer at https://dev.mysql.com/downloads/workbench/.

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.

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.

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.

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.

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.

Import Azure SQL Data into Excel

Open your Excel file. You can load your Azure SQL Database data into an existing Excel file, or start a new workbook.

Navigate to the Data tab. Click the Data tab or press Alt+A.

Click Get Data. This is in the Get & Transform Data section.

Select From Azure in the drop-down menu. This will show you Azure-related data options.

Click From Azure SQL Database. This will open the SQL Server database dialog box.

Type the name of the server. Formatted the server name like this: .database.windows.net Replace with the name of your server.

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.

Click Connect. This will open the data Navigator menu.

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.

What's your reaction?

Comments

https://kapitoshka.info/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!