Quick Tip: Shortcut a query in Oracle SQL Developer or SQL Server Management Studio
After going back and forth copy-and-pasting or trying to remember queries for my current project, I decided wanted to see if there was a better way. Good news: There is!
This was one of those topics that was a little difficult to nail down as far as wording for a Google search goes, so I'm jotting the steps down here to hopefully save others (and future me) some time. For those who like to know the source, I eventually found this info on a Stack Overflow post for Oracle SQL Developer and on c-sharpcorner for SQL Server.
Five steps to quicker querying in Oracle SQL Developer:
- Open Oracle SQL Developer.
- In the top toolbar, select Tools > Preferences > Database > SQL Editor Code Templates.
- Click Add Template. When the blue row appears in the list, type a shortcut in the first column and the query in the second column.
- Click OK.
- Now when you want to quick-paste your query in the editor, you can just type the shortcut!
Five steps to quicker querying in Oracle SQL Developer:
* Note: This one isn't as much fun because you can't choose your own shortcut (there is a set of predetermined ones to choose from) and it doesn't "paste" the query to the editor for you to see and manually manipulate.
- Open SQL Server Management Studio.
- Go to Tools > Options > Environment > Keyboards > Query Shortcuts.
- Choose a shortcut and write your query next to it.
- To run your query, select New Query and type your shortcut to execute the associated query.
Got any additional quick tips for Oracle SQL Developer or SQL Server Management Studio? Share them in the comments!