Are you tired of using heavy and resource-intensive IDEs for writing code against SQL Server databases? Look no further! Microsoft has introduced Azure Data Studio (ADS), a lightweight and efficient IDE based on their popular Visual Studio Code editor. In this article, we will explore some of the basics of working with ADS and how it can enhance your SQL Server development experience.
A Database-Centric Approach
Unlike traditional IDEs like SQL Server Management Studio (SSMS), Azure Data Studio takes a database-centric point of view. When you open ADS, you will notice a blank screen with a side menu. The side menu can be customized to your preference, either on the left or right side of the screen.
ADS allows you to connect to specific databases rather than instances. This means that each connection you set up in ADS is tied to a specific database. To connect to a database, simply click on the server icon or press F8. You will see a list of connections that you have set up. Clicking on a connection will open a dashboard for that database, displaying information such as recovery status, backups, compatibility level, and owner.
Query Writing Made Easy
The main function of Azure Data Studio is writing code and saving it. The editor provides basic IntelliSense functionality, offering suggestions as you type. However, the IntelliSense feature in ADS is limited compared to tools like SQL Prompt. While it provides keyword suggestions, it may not always provide a list of values for certain queries.
To execute a query, simply press F5 or use the Keymap extension to mimic the behavior of SSMS with CTRL+E. The results of the query will be displayed in a middle pane, along with any messages or errors. ADS also provides options to save the results in various formats such as CSV, Excel, JSON, and XML.
Customization and Productivity Features
Azure Data Studio offers several customization options to enhance your coding experience. You can easily adjust the font size by using the CTRL+= shortcut, making it easier to read the code. Additionally, ADS provides various color themes for the editor, allowing you to personalize the appearance of your workspace.
Working with folders in ADS is a breeze. You can open a folder and view all the code stored within it. The editor displays a list of files on the side bar, and you can easily switch between open files using the “Open Editors” section. ADS also provides helpful indicators to show which files have unsaved changes or potential code issues.
Pros and Cons of Azure Data Studio
Azure Data Studio offers several advantages over traditional IDEs like SSMS. It starts up quickly, allowing you to get to work without any delays. The editor also remembers your query windows, even if they were not saved, ensuring that you never lose your work. ADS also supports PowerShell files and provides an integrated terminal, similar to Visual Studio Code.
However, there are some limitations and annoyances with ADS. The results pane is fixed as a grid view, and there is no option to view results as text. Additionally, the object explorer in ADS is tied to the database connection, making it necessary to set up separate connections for each database you want to browse. There are also some ergonomic issues and occasional flakiness with certain features.
Conclusion
Azure Data Studio shows great promise as a lightweight and efficient IDE for SQL Server development. While it may not be a complete replacement for SSMS, it offers a different paradigm that focuses on code-first development and integration with version control. With its quick startup time, stability, and focus on coding, ADS can greatly enhance your productivity as a SQL Server developer.
In the next installment of this series, we will explore the integration of Azure Data Studio with version control and how it can streamline your coding workflow.