Ms Data Wizard
Ms Data Wizard
User's guide
Table of Contents
Foreword 0
II Getting Started 11
1 How to...................................................................................................................................
connect to Microsoft SQL 13
2 Templates
................................................................................................................................... 14
3 Command
...................................................................................................................................
line options 15
IV Data Export 29
1 Selecting
...................................................................................................................................
format of the result files 30
2 Adding
...................................................................................................................................
objects to export data from 31
3 Customizing
...................................................................................................................................
target columns properties 34
4 Setting...................................................................................................................................
general export options 35
Adjusting data..........................................................................................................................................................
formats 35
Setting format-specific
..........................................................................................................................................................
options 36
V SQL Dump 40
1 Selecting
...................................................................................................................................
source objects 41
2 Setting...................................................................................................................................
destination file names 42
3 Customizing
...................................................................................................................................
common dump options 43
VI Blob Import 44
1 Selecting
...................................................................................................................................
tables for import 45
2 Setting...................................................................................................................................
files for import 46
IX Options 56
1 Application
................................................................................................................................... 57
Preferences .......................................................................................................................................................... 57
2 Editors
...................................................................................................................................
& Viewers 59
General .......................................................................................................................................................... 59
Display .......................................................................................................................................................... 60
SQL highlight .......................................................................................................................................................... 61
XML highlight.......................................................................................................................................................... 62
PHP highlight .......................................................................................................................................................... 63
Code Insight .......................................................................................................................................................... 64
Code Folding .......................................................................................................................................................... 65
3 Appearance
................................................................................................................................... 67
Bars and menus.......................................................................................................................................................... 67
Trees and lists
.......................................................................................................................................................... 68
Edit controls .......................................................................................................................................................... 69
Check boxes .......................................................................................................................................................... 70
Buttons .......................................................................................................................................................... 71
Page controls.......................................................................................................................................................... 72
Group boxes .......................................................................................................................................................... 73
Splitters .......................................................................................................................................................... 74
Index 76
II
1 MS SQL Data Wizard Help
Key features:
· Data export to as many as 18 file formats
· Data import from Excel, CSV, text files and more
· Generating SQL dumps for selected tables
· Export BLOB data to files and load BLOB data from files
· Flexible Task Scheduler
· The Agent application to execute tasks in background mode
· Powerful command-line interface
Server environment
1.2 Installation
To install MS SQL Data Wizard on your PC:
· download the MS SQL Data Wizard distribution package from the download page at
our site;
· run setup.exe from the local folder and follow the instructions of the installation
wizard;
· find the MS SQL Data Wizard shortcut in the corresponding program group of the
Windows Start menu after the installation is completed.
You can select licensing options and register MS SQL Data Wizard at its on-line order
page. It is possible to purchase on-line, by fax, mail, toll-free phone call, or place a
purchase order. We send the software activation key by email within 24 hours after
completion of the order process. If you have not received the activation key within this
period, please contact our sales department.
All our products and bundles are shipped with 12 months of free upgrades (minor and
major ones) or with 36 months of free upgrades for a quite small additional fee. After this
period you may renew your license for the next 12(36) months with a 50% discount.
MS SQL Data Wizard has a free 30-day trial. Upon purchasing the product you confirm
that you have tested it and you are completely satisfied with its current version.
To obtain technical support, please visit the appropriate section on our website or
contact us by email to support@sqlmaestro.com.
· License grant. SQL Maestro Group grants you a license to use one copy of the
version of this SOFTWARE on any single hardware product for as many licenses as you
purchase. "You" means a company, an entity or an individual. "Use" means storing,
loading, installing, executing or displaying the SOFTWARE. You may not modify the
SOFTWARE or disable any licensing or control features of the SOFTWARE except as an
intended part of the SOFTWARE's programming features. This license is not
transferable to any other company, entity or individual. You may not publish any
registration information (serial numbers, registration keys, etc.) or pass it to any other
company, entity or individual.
· Ownership. The SOFTWARE is owned and copyrighted by SQL Maestro Group. Your
license confers no title or ownership of the SOFTWARE and should not be construed as
a sale of any rights for the SOFTWARE.
· Copyright. The SOFTWARE is protected by the United States copyright law and
international treaty provisions. You acknowledge that no title to the intellectual
property in the SOFTWARE is transferred to you. You further acknowledge that title
and full ownership rights to the SOFTWARE will remain the exclusive property of SQL
Maestro Group and you will not acquire any rights to the SOFTWARE except as
expressly set forth in this license. You agree that any copies of the SOFTWARE will
contain the same proprietary notices which appear on and in the SOFTWARE.
· replace existing version of the UNREGISTERED SOFTWARE installation package with the
new package immediately after a new version of the SOFTWARE is released by SQL
Maestro Group, or
· delete an obsolete version of the UNREGISTERED SOFTWARE installation package
immediately upon written email notice by SQL Maestro Group.
A registered copy of the SOFTWARE ("REGISTERED SOFTWARE") allows you to use the
SOFTWARE only on a single computer and only by a single user at a time. If you wish to
use the SOFTWARE for more than one user, you will need a separate license for each
individual user. You are allowed to make one copy of the REGISTERED SOFTWARE for
back-up purposes.
· Reverse engineering. You affirm that you will not attempt to reverse compile,
modify, translate, or disassemble the SOFTWARE in whole or in part.
· Unauthorized use. You may not use, copy, rent, lease, sell, modify, decompile,
disassemble, otherwise reverse engineer, or transfer the SOFTWARE except as
provided in this agreement. Any such unauthorized use shall result in immediate and
· No other warranties. SQL Maestro Group does not warrant that the SOFTWARE is
error-free. SQL Maestro Group disclaims all other warranties with respect to the
SOFTWARE, either express or implied, including but not limited to implied warranties of
merchantability, fitness for a particular purpose and noninfringement of third party
rights. Some jurisdictions do not allow the exclusion of implied warranties or limitations
on how long an implied warranty may last, or the exclusion or limitation of incidental or
consequential damages, so the above given limitations or exclusions may not apply to
you. This warranty gives you specific legal rights and you may also have other rights
which vary from jurisdiction to jurisdiction.
· Limited warranty. This SOFTWARE is provided on an "AS IS" basis. SQL Maestro
Group disclaims all warranties relating to this SOFTWARE, whether expressed or
implied, including but not limited to any implied warranties of merchantability or fitness
for a particular purpose. Neither SQL Maestro Group nor anyone else who has been
involved in the creation, production, or delivery of this SOFTWARE shall be liable for
any indirect, consequential, or incidental damages arising out of the use or inability to
use such SOFTWARE, even if SQL Maestro Group has been advised of the possibility of
such damages or claims. The person using the SOFTWARE bears all risk as to the
quality and performance of the SOFTWARE.
· Severability. In the event of invalidity of any provision of this license, the parties
agree that such invalidity shall not affect the validity of the remaining portions of this
license.
· No liability for consequential damages. In no event shall SQL Maestro Group or its
suppliers be liable to you for any consequential, special, incidental or indirect damages
of any kind arising out of the delivery, performance or use of the SOFTWARE, even if
SQL Maestro Group has been advised of the possibility of such damages. In no event
will SQL Maestro Group's liability for any claim, whether in contract, tort or any other
theory of liability, exceed the license fee paid by you, if any.
· Entire agreement. This is the entire agreement between you and SQL Maestro Group
which supersedes any prior agreement or understanding, whether written or oral,
relating to the subject matter of this license.
· Reserved rights. All rights not expressly granted here are reserved to SQL Maestro
Group.
The company was founded in 2002 as an essential partner for every business that is
trying to harness the explosive growth in corporate data. SQL Maestro Group employs an
international team concentrating their efforts on cutting-edge DBA tools development.
The slogan of our company is The Shortest Path to SQL. It is aimed to denote that we
set to create easy-to-use products meant for those who appreciate comfort, friendly
program interface and support when working with SQL servers.
At present, our company offers a series of Windows GUI admin tools for SQL
management, control and development of the following servers: MySQL, Microsoft SQL
Server, PostgreSQL, Oracle, SQL Anywhere, DB2, SQLite, Firebird, and MaxDB. We
also produce universal tools to be used for administering any database engine accessible
via ODBC driver or OLE DB provider. Such products may be the clear-cut decision for
those who constantly work with several database servers.
The software products are constantly optimized for the latest server versions support.
2 Getting Started
The Home page contains a set of links to run all the wizards included into the software.
Each wizard may be run in 3 ways:
file and execute it in background mode, specify a template file at the Home page
and click Run in background mode. Besides, you can specify a time to execute the
task within the Task Scheduler 52 .
· SQL Dump 40
· Blob Import 44
· Blob Export 48
Provider
The application allows you to connect to SQL Server using any of SQL Server Native
Clients installed on your computer. To choose a client you want to use, select the
appropriate item in the Provider combobox. The table below shows the correspondence
between the value selected in this combobox and SQL Server client to be used.
We would recommend you to install and use SQL Server 2012 Native Client as it (and
only it) supports SQL Server Express LocalDB. Also it provides the best support for data
types implemented in the recent versions of SQL Server.
2.2 Templates
MS SQL Data Wizard allows you to save and restore all options set during a wizard
session. You need not to specify all session parameters each time you work with a
wizard anew; instead you can load all settings from a template and change them if
necessary. To create a template, walk through the wizard and click More > Save
Template at the last step. All the settings you have made will be saved to a file. To
restore previously saved settings from a template, click More > Load Template at the
first wizard step.
Templates are very useful when working with MS SQL Data Wizard. If you will close any
wizard without saving a template, all carefully adjusted settings will be lost. To set the
same options next time, you'll need to repeat the process step by step again while with
a template all the session parameters can be restored in a few mouse clicks.
Examples.
The examples below assume that you are entering the command lines in the MS SQL
Data Wizard program directory. Don't forget to enclose all paths and filenames
containing spaces in quotes.
3 Data Import
Data Import wizard provides you with a graphical user interface to import data from the
most popular files formats into existing Microsoft SQL tables. It allows you to adjust data
formats, empty target tables, execute custom SQL scripts, etc. To run the wizard, use
the Run Data Import Wizard link at Home page 11 .
To import data,
· Set connection properties 13 of the database to import data to;
· Select the format 17 to use for the input data;
· Select the tables 19 where you want to import the data;
· Set source file options 21 ;
· Map source file columns and target table fields 23 ;
· Specify other import options 23 .
Specify the Default directory for source files and complete the Encoding, XPath, Data
location, Delimiter, and Quote fields if necessary. Turn ON the Empty targets before
importing option to delete all the records from target tables before the import starts.
In case you are importing from an ODBC source specify the Connection string for the
source database. The connection string must contain the information that the ODBC
driver or OLE DB provider need to know to be able to establish a connection to the
database or the data file. To learn more about ODBC drivers, OLE DB providers and other
such stuff, read our brief guide to connection strings. Select the type of quotes used by
the server as Quote characters identifiers to escape improper symbols and blanks in
object names.
Add an SQL query using the corresponding button and specify a file to load the query
from or place the query text in the corresponding window.
For MS Access files, specify a data table containing the data to be imported to the
selected Microsoft SQL table. Set the password for the source database if necessary.
For CSV, DSV, and TSV files, select the file encoding, the delimiter, and the quote.
Check the Header box to skip the first row of the file and uncheck otherwise.
For TXT and DBF files, select the source file encoding. For text files, check the Header
box to skip the first row of the file or uncheck it otherwise.
For .XML files, define the XPath to the data to be imported to the selected Microsoft
SQL table and select whether data are stored in Attributes or Subnodes.
<?xml version="1.0"?>
<DATAPACKET Version="2.0">
<Data>
<Item ID="1" FirstName="Klaus" LastName="Salchner" PhoneNumber="410-727-5112" />
<Item ID="2" FirstName="Peter" LastName="Pan" PhoneNumber="604-111-1111" />
</Data>
</DATAPACKET>
· You can map columns automatically by order with the Auto Fill and Auto fill all
maps buttons.
· You can do it manually for each table using the drop-down list of Source column
fields. To set the accordance in this way, select a target object in the list first.
The object columns appear in the Target field tab. Now select data to be imported
to the columns.
· To map columns visually, open Map builder 24 with the Build map link.
It's useful to save a specified map to a file for further using it in the next wizard
sessions. To save a map, use the More... button and follow the Save map link.
To see the 100 first rows of input file or output table, use the More... button and follow
the View source data or Preview results links respectively.
You can also specify Replacements to be applied to the selected column before the
import and data format masks 25 used for the input file.
To empty tables where you want to import data before the importation, check the
Empty target box. The default value of the boxes has been set earlier.
To exclude the first file row, use the File contains column header checkbox.
For text files define columns bounds first. To add a bound, double-click near the column
data in the builder area. To map a column to a target table field, select the field in the
Target field list and then click between the bounds.
The components of the date time format mask are represented at the window. Compose
your date, time, and date time format mask of this components and separators. The
following table contains some types of input fields and suggests masks to import them.
You can also set decimal and thousand separators, and custom NULL,TRUE and FALSE
values. If you have several values to be imported to NULL(TRUE, FALSE) value, use
semicolons to separate them.
Logging
Use this option to be informed about all the actions occurred during the import. The log
file name may contain current timestamp with the %ts:TIMESTAMP_FORMAT% string.
Examples of valid log file names:
dbname_import_%ts:yyyy_mm_dd%.log
import_%ts:yyyy_mm_dd_hh_mm%_mysql.log
%ts:yyyy_mm_dd_hh_mm_ss%.log
Email notification
To send a log file as an email attachment after each import process or in case of an
occurred error, specify settings of email(s) to be sent: parameters of your SMTP server,
email addresses, subject and body text.
Scripts
There are many cases where the import process is necessary to correct with additional
scripts. So to disable table indexes before the importing, specify the corresponding
scripts to be executed before and after the process.
The typical example of usage of the Before each table and After each table scripts is
the import data to autoincrement columns of several tables. In this case it's neseccary
to set the corresponding scripts:
SET IDENTITY_INSERT %table_name% ON
and
Import mode
If the Update existing records option is turned ON, the records will be either updated or
inserted: an UPDATE will be performed when a target row exists in the table and an
INSERT is performed when the target row does not exist.
Reorder
MS SQL Data Wizard arranges target tables on import by dependencies to inserted
records in the correct order. To reorder target tables manually, follow the corresponding
button.
4 Data Export
Data Export wizard is a tool to save data from Microsoft SQL tables, views, and queries
to the most popular formats. It allows you to fully customize output files including
header and footer, fonts, colors, and data formats. To run the wizard, use the Run Data
Export Wizard link at Home page 11 .
To use a custom SQL query as a data source, use the Create query button and enter
the query name and a SELECT statement. It is also possible to load a query from an .sql
file.
select * from
(
QUERY_TEXT_YOU_ENTERED
) an_alias
This happens because the software uses similar queries for internal needs. In case such
SQL expression is not valid, the wizard marks the query as invalid and displays its name
in red.
To meet this requirement, make sure that all the columns in the result dataset have
unique aliases. For example, the following query works fine itself, but returns a dataset
with two columns named id:
SELECT
table1.*,
table2.*
FROM table1, table2
WHERE table1.id = table2.id;
This is the reason the wizard marks this query as invalid. To solve the problem, provide
these columns with unique aliases:
SELECT
table1.id as table1_id,
table2.id as table2_id
FROM table1, table2
To specify the result file's header and footer, double click the corresponding button and
complete fields of the Header and Footer window.
To rename a target file column, double click the corresponding caption or select the
caption and use F2, and edit it manually.
OpenDocument Spreadsheet, OpenDocument Text, DBF, PDF, RTF, DIF, SYLK, and
LaTeX.
Microsoft Excel
The Data Format tab contains general options, which allow you to adjust the format for
each kind of Excel cells. This means that you can specify such parameters as font,
borders, filling color and method, etc. for each entity (such as data field, header, footer,
caption, data, hyperlink and so on) separately. Also it is possible to create styles to
make target Excel file be striped by columns or rows (the Styles tab).
The Extensions tab provides a possibility to add hyperlinks and notes to any cell of
target file. Click the Plus button to add a new hyperlink or note to target Excel sheet
and adjust its parameters. Click the Minus button to delete added hyperlink or note.
The Advanced tab allows you to define page header, page footer and title for target
Excel sheet.
HTML
The Preview tab allows you to select the style of HTML file from a number of built-in
templates provided by the Templates combo box. You can choose any of these
templates, customize it by clicking on objects in the preview panel, and save it as a
custom template using the Save template button. Use the Load template button to load
previously saved custom templates from hard disk.
The Basic tab allows you to specify basic parameters of target HTML file, such as its
title, cascade style sheet options, etc.
The Multi-file tab provides you with a possibility to split target HTML file into several
separated files. This tab allows you to specify the record count for a single file, set an
option to generate an index HTML file, and add an ability of navigation between each
other to each of exported files.
The Advanced tab contains such HTML options as default font, background, cell padding
and spacing, etc.
Text files
Set the Calculate column width options on if you want each column of target file to be
adjusted to the maximum number of characters in it. The Spacing option specifies the
number of spaces between columns in the target file.
CSV files
You can specify column separator and optional values quote character for the target file
on this step.
XML documents
Specify XML document encoding in the Encoding edit box and set the Standalone option
on if you wish the target document to be standalone.
5 SQL Dump
Along with such data management abilities as data import and export, MS SQL Data
Wizard allows you to dump data stored in Microsoft SQL tables and views. As the result
of the SQL Dump wizard activity you'll get a bunch of .sql files (each table or view is
dumped to a separate file) containing SQL statements to create a table and populate it.
To run the wizard, use the corresponding link at the Home page 11 .
Statement syntax
This allows you to specify the SQL syntax the result script to be written on. This feature
allows you to restore the dump contents to a table in a different database server such
as MySQL, PostgreSQL, SQL Server, Oracle, Firebird, or SQLite.
Output
Specify the output directory for the result files and the files encoding.
6 Blob Import
The wizard allows you to load BLOB data from external files to Microsoft SQL tables. For
this purpose the file names must contain the information on the record they need to be
placed to: the files need to be named in the same manner and include content of one or
several table columns that can uniquely identify each row.
To import BLOB files into Microsoft SQL tables, complete the following steps:
· Set connection properties 13 of the database you want to import BLOBs;
Example:
Suppose we have a table 'employee' with Non-Blob data as follows:
Id User
1 Max
2 July
To import D:\Data\1.jpg and D:\Data\2.jpg to a BLOB column of the table, specify D:
\Data as directory name and %Id%.jpg as file name template.
You can define the default root directory with %root_dir%, %table_name%, and %
field_name% tags.
7 Blob Export
To export BLOB data stored in Microsoft SQL tables to external files, complete the
following steps:
· Set connection properties 13 of the database you want to export BLOB data from;
· Specify file name templates 50 the BLOB data will be unloaded to.
You can define the default root directory with %root_dir%, %table_name%, and %
field_name% tags.
8 Task Scheduler
MS SQL Data Wizard allows you to schedule data manipulation tasks. To import/export
data, generate ASP.NET scripts, or convert Microsoft SQL data and structure in
background mode at a preset time, you need to:
Task Scheduler contains the list of scheduled tasks with the time and the result of the
last task execution, and the time of the next one. To open the page, use Task
Scheduler button at the Ribbon toolbar or the Show Task Scheduler link at the Home 11
page.
Adding a task
To add a task to the scheduler, use the Add Task button at the Ribbon toolbar or open
the Task Scheduler page and click Add Task at the Navigation bar or at the area's
popup menu. The Add Scheduled Task window will appear. Fill the window fields and
click OK.
Scheduled tool
Select the wizard for the task execution from the drop-down list.
Set the time for the task to be executed. To execute the task minutely, hourly, daily,
weekly or monthly, use the Each box and its drop-down list. To cease the task
executing at a specified date or after a certain number of the process repetitions, use
the Until and the For drop-down lists.
Select the Task type. Three options are available: Application schedule, System
schedule and Both types schedule. An application scheduled task is executed by the MS
SQL Data Wizard Agent itself i.e. it requires a user logon while system tasks can be
executed by the Windows scheduler service even without user logon.
To edit the selected task, use the Edit Task item of the Navigation bar or double
click the task. The Edit Scheduled Task window will appear. The window
parameters are similar as the parameters of the Add Scheduled Task window.
If necessary, you can run the configured task any time, irrespective of the
specified time. To execute the selected task, use the Execute task item of the
To enable the agent at each Windows startup, open Options 56 > Preferences and
check Run agent at startup.
9 Options
MS SQL Data Wizard allows you to customize the way it works within the Options dialog.
To open the dialog, use the More button and select Options at the drop-down list.
The window allows you to customize the options grouped by the following sections:
· Application 57
General MS SQL Data Wizard options: environment style, confirmations, window
restrictions.
· Appearance 67
Customizing program interface - bars, trees, menus, etc.
It is a good idea to check through these settings before you start working with MS SQL
Data Wizard. You may be surprised at all the things you can adjust and configure!
9.1 Application
The Application section allows you to customize common rules of MS SQL Data Wizard
behavior. The section consists of several tab; follow the links to find out more about
each of them.
· Preferences 57
9.1.1 Preferences
Agent options
The option allows you to launch MS SQL Data Wizard Agent at each Windows startup for
executing tasks configured in Task Scheduler 52 , in background mode.
You can also cancel/allow the confirmation dialogs with the Confirmations options.
· General 59
· Display 60
· SQL highlight 61
· PHP highlight 63
· XML highlight 62
· Code Insight 64
· Code Folding 65
9.2.1 General
If the Auto indent option is checked, each new indention is the same as the previous
when editing SQL text.
Insert mode
If this option is checked, insert symbols mode is default on.
Tab Stops
Defines the tab length, used when editing text.
Undo Limit
Defines the maximum number of changes possible to be undone.
9.2.2 Display
You can disable/enable the right text margin and the gutter of the editor area, set the
position of the right text margin as Right margin, and the Gutter width.
Use the Editor font and Font size to define the font used in all program editors and
viewers. The panel below displays the sample of the selected font.
You can enable/disable code folding in SQL editors and viewers and customize the colors
of its items.
9.3 Appearance
The Appearance section allows you to customize the application interface style to your
preferences.
Use the Scheme name box to select the interface scheme you prefer: Office XP style,
Windows XP native style , etc. You can create your own interface schemes by
customizing any visual options (Bars and menus, Trees and lists, Edit controls, Check
boxes, Buttons, etc.) and clicking the Save As button. All the customized options are
displayed on the sample panel.
· Edit controls 69
· Check boxes 70
· Buttons 71
· Page controls 72
· Group boxes 73
· Splitters 74
The item allows you to select Bar style and menu animation from the corresponding
drop-down lists and to enable or disable such options as sunken border, F10 key for
opening menu, viewing full menus after delay, flat close buttons, gray-scale images.
9.3.5 Buttons
Use the Buttons item to customize MS SQL Data Wizard buttons. The tab allows you to
adjust the appearance of buttons and define sample buttons as well.
9.3.8 Splitters
Use the Splitters item to customize all MS SQL Data Wizard splitters according to your
preferences. Use the tab to select hot zone style (Windows XP task bar, Media Player 8,
Media Player 9, Simple or none) and specify the Hot zone drags a splitter option.
Index -I-
Import Data Wizard
-A- Adding SQL queries 20
Customizing common options 27
Appearance Options Data Format 25
Bar and menus 67 Map builder 24
Buttons 71 Overview 16
Check boxes 70 Selecting files to import from 21
Edit controls 69 Selecting objects to import to 19
Group boxes 73 Selecting source format 17
Page controls 72 Setting fields correspondence 23
Splitters 74 Installation instructions 3
Trees and lists 68
-L-
-B- License Agreement 5
BLOB Export Wizard 48
Selecting tables for export 49
Setting file name templates 50 -M-
BLOB Import Wizard 44 MS SQL Data Wizard
Selecting tables for import 45 Agent 55
Setting files for import 46 Command line options 15
Connection options 13
EULA
XML highlight 62
5
-O-
Export Data Wizard Options 56
Adjusting data formats 35 Appearance 67
Overview 29 Application 57
Selecting fields 34 Application preferences 57
Selecting file format 30 Editor & Viewers 59
Selecting objects to export data from 31
Setting format-specific options 36
-P-
Purchase MS SQL Data Wizard 4
-R-
Registration 4
-S-
SQL Dump Wizard
Customizing common options 43
Overview 40
Source objects 41
Target files 42
System requirements 2