SqlCodeLayoutFilesTask
Introduction
Section titled “Introduction”This topic the MSBuild SqlCodeLayoutFilesTask task that is available with SQL Enlight.
SqlCodeLayoutFiles
Section titled “SqlCodeLayoutFiles”The task reformats T-SQL script files using given layout template.
Parameters
Section titled “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 files\result” . |
| 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: “My Favorite Layout Template”Or”D:\My Layout Templates\My 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
Section titled “Example”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>