ApexSQL Complete – SQL snippets

This tutorial describes the use of built-in snippets in ApexSQL Complete as well as creating and using new snippets. Using snippets reduces of the lines of code that has to be typed, and thus decreases the potential for errors that could occur from typing.

Transcript

Hello, and welcome to this video presentation on how to create and use SQL snippets in ApexSQL Complete.

In the ApexSQL Complete there are over 200 built-in snippets and they are placed in the list under the Snippets tab.

To access the snippets library, from the ApexSQL Complete menu, click the Options command and switch to the Snippets tab:

This will open the Snippets tab, showing the list of snippets, including SQL code for each snippet.

To create a snippet, click the Options command from ApexSQL Complete menu and click the New button, this will open the Create snippet form:

Type a name of a snippet, in the code section insert some code and click the OK button.

Another way to create a snippet is to pick snippet code directly from the query window.

Let’s paste the same code in the query window.

Select the code.

Right-click in the query window, and choose the New snippet command:

As you can see, the selected code will be automatically inserted in the code section of the Create snippet form.

Type a name of the snippet and click the OK button.

Let’s delete this.

To use created snippet, right-click in the query window and choose the Insert snippet command:

The hint–list with all available snippets will be shown.

Choose desired snippet from the list:

Another method for inserting snippets is to start typing the snippet name in the query window and choose a snippet from the hint-list:

By default, SQL snippets appear in the hint-list. To remove them go to the ApexSQL Complete menu, choose the Options command, and under the Hints tab uncheck the Snippets check box:

SQL snippets can be copied from one to another machine where is already installed ApexSQL Complete by using the Export/Import options from the Snippets tab:

When using the Export option, all (built-in and user defined) SQL snippets will be compressed as Snippets.zip file.

To import SQL snippets in the Snippets tab, click the Import button, from the Open window, navigate to the Snippets.zip file and click the Open button:

This will import SQL snippets in the list under the Snippets tab.

Thanks for watching. For more information, please visit www.apexsql.com

Note: Executed queries feature has been renamed to Query history