SQL Database Query Editor in Azure Portal: A Deeper Look
Query Editor is a great tool but has very limited features. It has a subset of the functionality of SQL Server Data tools and SQL Server Management Studio.
Join the DZone community and get the full member experience.Join For Free
Imagine that you have hosted SQL Server Database on Microsoft Azure Cloud and you learn that there is some error in your SQL query. You don't have SQL Server Management Studio to fix the error. Scared? No, you don't need to be. Luckily, Microsoft Azure has a solution to your problem.
A year ago, Microsoft announced a new feature for SQL Server databases in Azure called Query Editor (which is still in preview mode) to handle such situations and help developers write SQL queries right from their browsers. It is a compact version of SQL Server Data Tools (available in Visual Studio) with limited functionality.
Getting Started With Query Editor
Query Editor comes along with SQL databases; you don't need any additional configurations. Click SQL Database and you will find Query editor be in the left pane.
Selecting Query editor will open a new blade.
First, you need to log into your SQL Server with the credentials. Query Editor allows the following three ways to log into SQL server:
- Active directory single sign-on (SSO).
- SQL Server authentication.
- Active directory password authentication.
All you need to do is select the method and proceed by hitting OK. Upon successful login, you will see the following window.
Exploring Query Editor
The following objects can be found in Query Editor:
Tables: A list of all the tables and table structures (can be found by expending the tree).
Views: List of all views.
Stored procedures: List of all system- and user-defined stored procedures.
Query Editor allows you create multiple tabs and execute multiple queries simultaneously. You can write simple and complex queries, as well. You can write new queries and you can upload queries, as well (all text file formats are supported).
In the case of select queries, you directly search from your resultset, as well.
Editing Records in a Table
Just like SQL Server Management Studio and SQL Server Data Tools, Query editor allows you to edit table records right from your browser. You can create new rows, delete rows and edit the record of a particular row as well.
In order to edit records of a table, you need to perform the following steps:
Select a table.
Click Edit Data
Double-click on the record to edit.
The table will be loaded in a new tab of the blade.
Query Editor is a great tool but it has very limited features. It has a subset of the functionality of SQL Server Data tools and SQL Server Management Studio. It is still in preview mode and not robust as other tools.
Opinions expressed by DZone contributors are their own.