In this article, we will introduce how to use ApexSQL Refactor SQL formatting profiles and is a guide through the process of managing SQL formatting profiles.
Transcript
Hello, and welcome to this video presentation in which we will introduce how to use ApexSQL Refactor SQL formatting profiles and is a guide through the process of managing SQL formatting profiles.
Four built-in profiles come with the installation of ApexSQL Refactor which can be used to format your SQL code:
- ApexSQL
- Compact
- Extended
- MSDN SQL BOL
These four profiles cannot be changed in any way. For example, if you try to change some settings the following message will appear:
Or to edit profile:
The similar message will appear if you try to delete a built-in formatting profile:
Create SQL formatting profile
To create a new profile from an existing built-in or user-defined profile, from the Profile drop-down list, choose the profile which should be copied and click the Copy button:
Under the Copy profile window, if needed the name, author, and description can be changed:
When all is set, click the OK button, and the newly copied profile will appear in the Profile drop-down list:
To create a completely new formatting profile, click the New button and under the Create profile window, enter a name for a profile. Optionally, you can add an author name of the profile and the description of an additional explanation of the profile. When everything is set, click the OK button:
Please note, in order to formatting profile be saved for later usage in the Options window, click the Save button otherwise, the newly created profile won’t be saved.
Edit user-defined SQL formatting profiles
To edit newly created profile information, click the Edit button, in the Edit profile window, change the information and click the OK button:
Delete user-defined SQL formatting profile
To delete the profile, from the Profile drop-down list, select a user-defined profile that should be deleted and click the Delete button. In the confirmation dialog, click the Yes button. The deleted profile will be removed from the Profile drop-down list:
In order for changes to take effect, in the Options window, click the Save button.
Export/import SQL formatting profiles
To export user-defined profiles in the Options window, click the Export button and, from the Export profiles window, select the profiles and click the OK button:
The exported formatting profiles will be saved as an XML document.
The opposite process of exporting is importing formatting profiles. In the Options window, click the Import button, locate formatting XML file and click the Open button:
From the Import profiles window, select the profiles that should be imported and click the OK button:
Set default SQL formatting profile
To format a SQL code using your newly created formatting profile, in the query editor, right-click and from the Format SQL by profile sub-menu, choose your formatting profile:
Another way to initiate this command is via ApexSQL Refactor main menu:
To set a newly created profile to be a default profile for future formatting of SQL code, go to the Options window, in the Profile drop-down list, select the profile and click the Set as active button:
Now, you can use the Format SQL command via ApexSQL Refactor toolbar or use the Ctrl+Shift+Alt+F shortcut to format SQL code in the query editor with default profile:
Thanks for watching. For more information, please visit www.apexsql.com