Skip to content

Document Options

Danny Quinn edited this page Sep 29, 2018 · 8 revisions

There are three options that you can specify at the top of a document that change behaviour. These are Space As, Null As and Copy Sql To.

Space As & Null As

By default, the SQL parser treats an empty or blank cell as null rather than an empty string. To have the SQL generate a space rather than a null, enter $space in the cell.

Doc

To have the parser treat blank cells as spaces you can add the line to the top of the file. If this option is specified and you want to include a null value, use $null.

Doc

As well as specifying default you can also pick a custom token to represent a space.

Doc

When using a custom token the default null behaviour remains the same.

You can also set a custom token to indicate null values

Doc

When both Null As & Space As are set to something other than default, a blank cell is interpretted as an empty string

Both of these keywords are optional but if they are included, Null As has to be the first line in the file followed by Space As and both must appear before a Table keyword.

Copy Sql To

On the Getting Started page is an example that shows how to link the SQL file to a database project. This works perfectly well and the Copy Sql To keyword simply offers another way of doing things rather than fixing a problem.

Copy Sql To will create a copy of the SQL output at the location specified. Note - this location must be a valid solution folder.

Doc

Creates a new file in the Scripts folder of the Sample.Database project. The paths are relative to the solution.

If you change the content of the template and save the file, both copies of the SQL file will be updated. Also, renaming the template file will rename the child files and the copied file.

One thing to note - If you delete the template file, a copied file will not automatically be deleted. This must be done manually.

As with the Null As and Space As keywords, Copy Sql To is optional. It must appear after Null As and Space As (if used) and before the first Table keyword.

Clone this wiki locally