Skip to content

SqlCodeLayoutFilesTask

This topic the MSBuild SqlCodeLayoutFilesTask task that is available with SQL Enlight.

The task reformats T-SQL script files using given layout template.

NameDescription
quietSuppresses all except error output messages.
InputPathRequired. Source T-SQL files location. Multiple files can be provided by separating each file with semicolon. The ’-’ prefix can be used to exclude specific files. Example: “c:\my files*.sql” .
OutputPathRequired. Output location for the reformatted T-SQL script files. Example: “c:\my files\result” .
TemplateNameExact name of the layout template or external layout template file which to be used. The default layout template will be used in case this argument is not provided.Example: “My Favorite Layout Template”Or”D:\My Layout Templates\My Favorite Layout Template.layouttemplate”
IncludeSubfoldersInclude files in sub folders.
LicenseKeyRequired. SQL Enlight for Build Machines license key.
LicenseDataRequired. Path to a license activation response XML file.

Example MSBuild project SqlCodeLayoutFiles:

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Ubitsoft.SqlEnlight.Tasks.SqlCodeLayoutFilesTask"
AssemblyFile="C:\Program Files (x86)\Ubitsoft\SQL Enlight\Ubitsoft.SqlEnlight.Tasks.dll" />
<PropertyGroup>
<SqlEnlight_LayoutInputPath>E:\Projects\MyProject\SQL Script\*.sql</SqlEnlight_LayoutInputPath>
<SqlEnlight_LayoutOutputPath>E:\Projects\MyProject\SQL Script\Reformatted\</SqlEnlight_LayoutOutputPath>
<SqlEnlight_LayoutTemplate>C:\Program Files (x86)\Ubitsoft\SQL Enlight\Templates\Layout\Ubitsoft Favorite 1.layouttemplate</SqlEnlight_LayoutTemplate>
<SqlEnlight_LicenseKey>ABCD-1234-XYZ-QWER-AAAA</SqlEnlight_LicenseKey>
<SqlEnlight_LicenseData>E:\SQL Enlight\license-activation-response.XML</SqlEnlight_LicenseData>
</PropertyGroup>
<Target Name="LayoutScriptsTarget">
<Message Text="Starting SQL script layout..." />
<Message Text="Running SQL script layout '$(SqlEnlight_LayoutInputPath)'..." />
<SqlCodeLayoutFilesTask
ContinueOnError="false"
TemplateName="$(SqlEnlight_LayoutTemplate)"
InputPath="$(SqlEnlight_LayoutInputPath)"
OutputPath="$(SqlEnlight_LayoutOutputPath)"
LicenseKey="$(SqlEnlight_LicenseKey)"
LicenseData="$(SqlEnlight_LicenseData)" />
<Message Text="Completed SQL script layout!" />
</Target>
</Project>

SqlCodeAnalyzeFilesTask

SqlCodeAnalyzeServerTask

SqlCodeRefactorFilesTask