Search⌘ K
AI Features

Saving Queries and Snippets

Explore how to save and organize SQL queries in Azure Data Studio using folder structures and how to create reusable code snippets. Understand the process of saving queries, configuring user snippets with variable substitution, and testing snippet usage to streamline your SQL editing workflow.

Organizing our queries and snippets

When working with multiple file-based queries, it is helpful to organize related scripts into a common folder structure. To achieve this, you simply select (or optionally create) a folder using the File menu’s “Open Folder” command, as shown in the figure below. This will establish your current folder context:

In case you need to create a new folder, you can still use the “Open Folder” dialog box. This is done by clicking in the white space (next to the existing folders), where you will be able to enter a new folder name via a pop-up window. The navigation for this user action is presented below:

Once you have selected your current folder context, queries and scripts that you later save will be placed in this folder by default. The file icon in the Activity Bar shown below provides the name of your current folder ...