Reputation: 7729
How can I create query shortcut for 'select * from' in Azure Data Studio ver 1.9.0? I see option to go to Keyboard shortcuts (Azure Data Studio / Preferences / Keyboard Shortcuts) but no query shortcuts.
When I type select, I do get drop down for selecting sqlSelect but its too cumbersome to edit it and put table name etc in it.
Any options?
Upvotes: 5
Views: 6340
Reputation: 145
To setup query shortcuts, assuming you already set your preferred shortcut(*) to some keyboard key combinations
(ex: workbench.action.query.shortcut5:ctrl+5)
Now go to Azure Data Studio / Preferences / Settings
Search for sql.query.shortcut* and type there you query/store procedure.
(ex: sql.query.shortcut5: "Select top 100 * from ")
Upvotes: 8
Reputation: 699
You can make your own Code Snippets in Azure Data Studio.
Ctrl/Cmd
+ Shift
+ P
) and search for Open User Snippets
SQL
for your language.{
"Select All": {
"prefix": "sqlSelectAll",
"body": "select * FROM ${1:TableName}",
"description": "User-defined snippet example 1"
}
}
sqlSelectAll
in this case, and it should appear.Source - https://learn.microsoft.com/en-us/sql/azure-data-studio/code-snippets?view=sql-server-ver15
Upvotes: 2