DatabaseSpy‘s SQL Editor is loaded with many feautres that can make working with SQL extreamly easy. I will try to point out a few that I use daily and that should prove useful.
Create SELECT statements quickly
From the Online Browser of DatabaseSpy select any table and view and drag it into an open SQL Editor. DatabaseSpy will generate a SQL Select statement for you.
For additional statements just right-click and drag the table. A context menu will appear giving you the option to generate CREATE, ALTER, SELECT and other kind of statements.
Results can be stacked or tabbed
The results of your execution can be shown in a single stacked window or in multiple tabbed windows. It is also possible to toggle this behavior, so that after execution you can dynamically alter how you wish to view the results. If you chosed to view the results tabbed you can easily dock the tabbed window on another side of the document giving you a lot of flexibility. This could be very useful whe wanting to view tables that have one to two columns.
Name Result Windows
When executing the same script on a daily basis which may produce multiple result windows DatabaseSpy gives you the ability to name the results to easily bind the statement to the result. This is acomplished by embedding the keywords target: <name> as a comment above the statement producing the result.
The SQL Editor from DatabaseSpy also added formattting in the last release. There are multiple options which allows you to customize formatting for each database kind that is natively supported and for multiple statement kinds.
These options are accessbile via the “formatting options” dialog which can be opened from the “general options” dialog in DatabaseSpy.
Store and Describe your SQL Files
This feature is not so much a SQL Editor feature as it is a feature of the project management inside of DatabaseSpy, but its something that makes my daily usage of SQL files easy. For scripts that I want to save I add them to the project that I am working on. This can be done via the context menu from the project window or from the context menu available from the active document’s tab.
Once addded to the project I describe my SQL file in the property window of DatabaseSpy. When hovering over the file in the project window later on I can view the description as a tooltip which makes finding my scripts much easier.
Many more features
There are of couse many other features to the SQL Editor such as auto completion and SQL refactoring. I may mention them in another post. I just tried to cover some of those features which I use on a daily basis.