<sql>

[This is preliminary documentation and subject to change.]

A task to execute arbitrary SQL statements against a OLEDB data source.

You can specify a set of sql statements inside the sql element, or execute them from a text file that contains them. You can also choose to execute the statements in a single batch, or execute them one by one (even inside a transaction, if you want to).

Parameters

AttributeTypeDescriptionRequired
connstringstring Connection string used to access database. This should be an OleDB connection string. True
delimiterstring String that separates statements from one another. True
delimstyleDelimiterStyle Kind of delimiter used. Allowed values are Normal or Line. True
appendbool Whether output should be appended to or overwrite an existing file. The default is false. False
batchbool If true, the statements will be executed as a single batch. If false, they will be executed one by one. Default is true. False
cmdtimeoutint Command timeout to use when creating commands. False
encodingEncoding The encoding of the files containing SQL statements. The default is the system's current ANSI code page. False
expandpropsbool If true, the any nant-style properties on the sql will be expanded before execution. Default is true. False
outputstring If set, the results from the statements will be output to the specified file. False
printbool If set to true, results from the statements will be output to the build log. False
quotecharstring The character(s) to surround result columns with when printing, the default is an empty string. False
showheadersbool If set to true, prints headers for result sets. The default is true. False
sourcestring File where the sql statements are defined. False
transactionbool If set to true, all statements will be executed within a single transaction. The default is true. False
failonerrorbool Determines if task failure stops the build, or is just reported. The default is true. False
ifbool If true then the task will be executed; otherwise, skipped. The default is true. False
unlessbool Opposite of if. If false then the task will be executed; otherwise, skipped. The default is false. False
verbosebool Determines whether the task should report detailed build log messages. The default is false. False

Examples

Requirements

Assembly: NAnt.Contrib.Tasks (0.93.5521.0)