SqlCodeLayoutFilesTask |
![]() |
This topic the MSBuild SqlCodeLayoutFilesTask task that is available with SQL Enlight.

The task reformats T-SQL script files using given layout template.
Parameters
Name |
Description |
---|---|
quiet |
Suppresses all except error output messages. |
InputPath |
Required. 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” . |
OutputPath |
Required. Output location for the reformatted T-SQL script files. Example: “c:my filesresult” . |
TemplateName |
Exact 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: Or “D:My Layout TemplatesMy Favorite Layout Template.layouttemplate” |
IncludeSubfolders | Include files in sub folders. |
LicenseKey |
Required. SQL Enlight for Build Machines license key. |
LicenseData |
Required. Path to a license activation response XML file. |
Example
Example MSBuild project SqlCodeLayoutFiles:
1<?xml version="1.0" encoding="utf-8"?> 2<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 4 <UsingTask TaskName="Ubitsoft.SqlEnlight.Tasks.SqlCodeLayoutFilesTask" 5 AssemblyFile="C:Program Files (x86)UbitsoftSQL EnlightUbitsoft.SqlEnlight.Tasks.dll" /> 6 7 <PropertyGroup> 8 <SqlEnlight_LayoutInputPath>E:ProjectsMyProjectSQL Script*.sql</SqlEnlight_LayoutInputPath> 9 <SqlEnlight_LayoutOutputPath>E:ProjectsMyProjectSQL ScriptReformatted</SqlEnlight_LayoutOutputPath> 10 <SqlEnlight_LayoutTemplate>C:Program Files (x86)UbitsoftSQL EnlightTemplatesLayoutUbitsoft Favorite 1.layouttemplate</SqlEnlight_LayoutTemplate> 11 <SqlEnlight_LicenseKey>ABCD-1234-XYZ-QWER-AAAA</SqlEnlight_Refactorings> 12 <SqlEnlight_LicenseData>E:SQL Enlightlicense-activation-response.XML</SqlEnlight_Refactorings> 13 </PropertyGroup> 14 15 <Target Name="LayoutScriptsTarget"> 16 17 <Message Text="Starting SQL script layout..." /> 18 <Message Text="Running SQL script layout '$(SqlEnlight_LayoutInputPath)'..." /> 19 20 <SqlCodeLayoutFilesTask ContinueOnError="false" 21 TemplateName="$(SqlEnlight_LayoutTemplate)" 22 InputPath="$(SqlEnlight_LayoutInputPath)" 23 OutputPath="$(SqlEnlight_LayoutOutputPath)" /> 24 LicenseKey="$(SqlEnlight_LicenseKey)" 25 LicenseData="$(SqlEnlight_LicenseData)" 26 <Message Text="Completed SQL script layout!" /> 27 </Target> 28</Project>
