SQL Exporter

The SQL Exporter executes a SQL statement for each row in the search-result.

See also Common commandline arguments!

Input configuration file

Required argument!
Short form: -i
Long form: --input
Example: -i ..\groups.xml
Contains all database relevant configuration. See DbExportSample1.xml for an example.

DB connection string override

Short form: -d
Long form: --db
Example: --db "Data Source=.;Initial Catalog=master;Integrated Security=True"
Default: use the connection-string provided in the XML file

New in Version 1.3.0.2
If specified, the connection string supplied by commandline will override the one specified in the configuration. This allows the same XML to be used for different databases.

Input configuration file XML schema reference

Attribute: continueOnError

Possible values: true, false, 0, 1
Default: false
Wether to continue processing the next record, if a SQL error occurs.

Attribute: commandType

Possible values: Text, StoredProcedure
Default: Text
Wether to continue processing the next record, if a SQL error occurs.

Attribute: providerName

Possible values: Any factory registered with System.Data.Common.DbProviderFactories
Default: SqlClient Data Provider
You can use either the displayname, or the invariant (assembly) name. A list of registered providers is shown, if you omit the required parameters for the SQL command. Here is a sample list of providers which might be shown on your system:
Display Name Invariant Name
Odbc Data Provider System.Data.Odbc
OleDb Data Provider System.Data.OleDb
OracleClient Data Provider System.Data.OracleClient
SqlClient Data Provider System.Data.SqlClient
Microsoft SQL Server Compact Data Provider System.Data.SqlServerCe.3.5

Attribute: suppressSqlInfoMessages

Possible values: true, false, 0, 1
Default: false
Wether to print out (false), or suppress (true) any (ie TSQL PRINT statement) textual output from the SQL statements. Currently, this is only supported by the SqlClient provider.

Element: ConnectionString

Possible values: a connection string which can be interpreted by the chosen provider
Default: empty
Example: Data Source=.\SQLExpress;Initial Catalog=MASTER;Integrated Security=True

Element: CommandText

Possible values: a valid SQL statement compatible with the target DBMS
Default: empty
Example: IF NOT EXISTS (SELECT * FROM sys.syslogins WHERE loginname = @cn) print 'User ' + @cn + ' does not exist as login!'
Use any attributes prefixed with the parameter sign @ to pass variables

Last edited Jun 25, 2013 at 12:12 PM by uTILLIty, version 3

Comments

No comments yet.