ApexSQL Complete – How to create and use SQL code text auto-replacements

This video shows how to use the Auto-replacement feature in ApexSQL Complete, that allows you to replace any text previously specified with the appropriate keyword, object name or any kind of SQL code.

Furthermore, you can auto-correct common typing errors, add some often used SQL statements, and in that way speed up SQL coding.

Transcript

Hello, and welcome to this video presentation in which I’ll describe how to use Auto-replacements. Auto-replacements allows you to replace any text (usually just a few characters) with a different block of text (usually much bigger) and in doing so, save a lot of typing. Using Auto-replacements, you can also auto-correct common typing errors.

To enable Auto-replacements, toggle the Enable auto-replacement option from the main menu:

All auto-replacement items can be accessed through the Auto-replacements dialog, which can be initiated from the same menu:

You can edit or delete any of the existing auto-replacement items, or create new ones.

To create a new auto-replacement, choose the New option, in the Replace field, specify the string that you want to be replaced, for example. Add. In the With section, specify SQL code that will be automatically replaced after the string from the Replace field is typed in the Select:

When an auto replacement substitution is created instances of the auto replacement expressions are automatically replaced by the specified string when you press the space bar in this example when pressing the space bar after typing add it will be replaced on the fly with the code that we’ve just created.

To use database object names in your SQL code, right-click on an object in the Object Explorer pane, select the Assign auto-replacement option:

The Auto-replacement dialog appears offering you to specify the string that you want to be replaced with an object name in the Replace field:

When you type the specified string, and hit one of the insertion keys, it will be auto-replaced with the object name.

Auto-replacements are saved in the Replacemets.xml file:

Also, you can edit all replacements, and add new ones by modifying the content of the Replacements.xml file.

Now, let’s execute the saved replacement.

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