Manual Completo Winsql
Manual Completo Winsql
Manual Completo Winsql
WinSQL® Professional
User’s Guide
Version 7.5
Table of Contents
Overview
WinSQL Professional is a utility designed to interact with
many different types of databases. This WinSQL
Professional User's Guide is designed to provide details
instructions for installing, configuring, and using the
program. It also includes information about more
advanced features, such as data export, test data
generation and schema diff.
Audience
The WinSQL Professional User's Guide is designed for
use by database administrators, system administrators,
programmers, and other technical staff.
Document Conventions
The following conventions are used throughout this
document:
Convention Description
Keyboard keys and Begin with an uppercase letter and
function keys appear in bold type, enclosed in
brackets; for example, [Enter] or [F1].
Format Indicates…
Green text a hyperlink to another section of this
document or to a web site
Format Indicates…
Bold a reference to a window or to an object in
a window, such as an icon, field, or
column; also indicates emphasis on a
critical instruction or step
Overview
Introduction
This chapter provides information about downloading,
installing, and configuring WinSQL Professional.
In this chapter
This chapter contains the following topics:
Topic See
Page
Requirements 2
Installation and Set Up 3
Obtaining a Serial Number 4
Registering WinSQL Professional ODBC Drivers 5
Creating ODBC Connections 7
Establishing a Database Connection 10
Sample Connection Strings 12
Connection Options 17
Uninstalling WinSQL Professional 19
Customizing Shortcut Keys 20
Requirements
WinSQL Professional is a 32-bit program that runs only
® ®
on Microsoft Windows XP, Windows 2000, Windows
2003 and Windows Vista. It uses ODBC to connect to
any target database for which a driver is available.
WinSQL Professional requires that you use ODBC
Manager version 3.x or higher. Although version 3.x is
required as the ODBC Manager, you can use a driver
that is compliant with version 2.x. However, if you use an
older driver, you may not be able to use all of the
features of WinSQL Professional.
To confirm the version of ODBC Administrator currently
installed, click Help, and then click About in the ODBC
Data Source Administrator window. If version 3.x or
higher is not installed, download the most current
version from http://www.microsoft.com/data/odbc.
Configuring ODBC
Configuring ODBC and creating data sources is required
before WinSQL Professional can be used for database
management. The following topics describe these
procedures.
Connection Strings
A connection string is a set of connection parameters
that tell WinSQL Professional how to connect to a
remote database. If you want to use a connection string
for connecting to a database, or if your application
requires it, you must specify a DSN (data source name),
a File DSN, or a DSN-less connection in the string. The
difference is whether you use the DSN=, FILEDSN=, or
the DRIVER= keyword in the connection string, as
described in the ODBC specification. A DSN or
FILEDSN connection string tells the driver where to find
the default connection information. Optionally, you may
specify attribute=value pairs in the connection string to
override the default values stored in the data source.
Beginning with ODBC Administrator version 4.0, a DSN
is not required to establish a database connection. To
use a connection string rather than a DSN connection,
click the Specify connection string checkbox. The
following window is displayed:
DBase / FoxPro
Firebird
DRIVER=Firebird/InterBase(r)
driver;uid=sysdba;pwd=secret;dbname
=<c:\data>\test.fdb
Informix
IBM DB2
myServerName;port=myPortNum;protoco
l=TCPIP;uid=myUserName;pwd=secret
Mimer
Driver={MIMER};Database=yourDatabas
e;uid=yourUserID;Pwd=secret;
MS Access
Standard Security
Driver={Microsoft Access Driver
(*.mdb)};Dbq=c:\mydb.mdb;Uid=Admin;
Pwd=;
Workgroup
Driver={Microsoft Access Driver
(*.mdb)};Dbq=C:\mydb.mdb;SystemDB=C
:\mydb.mdw;
MS Excel
MS SQL Server
Driver={SQL
Server};Server=192.168.1.50,4321;ui
d=sa;pwd=secret;Database=YourDB;
MySQL
Oracle
Paradox
PostgreSQL
Driver={PostgreSQL};Server=ipaddres
s;port=5432;Database=yourDBname;uid
=yourId;pwd=secret;
Sybase
Text Files
*.csv)};Dbq=c:\data\;Extensions=asc
,csv,tab,txt;
Connection Options
Database Type / WinSQL Professional Plug-in
This connection option specifies the type of database to
which you are connecting, and it also specifies a
database plug-in. The names displayed in this list
include the database plug-ins identified by WinSQL
Professional when it is started. Choice of database type
is only available in WinSQL Professional.
For more information about plug-ins, see “Database-
Specific Plug-Ins” later in this document.
Important note:
If the database to which you are trying to connect is
not displayed in the list, it does not mean you
cannot connect to that database with WinSQL
Professional. It means that WinSQL Professional will
not be able to query specific database features,
such as triggers and SQL scripts for views and
stored procedures.
Note:
Any combination of control keys (Shift, Alt, and
Ctrl), plus a letter or number, can be used. The
only exception is Ctrl+[space bar], which is
reserved for use by Intelli Tips.
Overview
Introduction
This chapter provides information about creating,
running, viewing, saving, and printing queries within
WinSQL Professional.
In this chapter
This chapter contains the following topics:
Topic See
Page
Screen Layout 25
Integrated View 25
Classic View 26
Switching Views 26
Writing SQL Scripts 27
Query Pages 28
Query Set Workbook 28
Using Clipboard 29
Extended Copy – Code 29
Extended Copy - Results 30
Displaying Query Results 32
Intelli Tips 43
Data Lookup 45
Topic See
Page
Configuring Data Lookup Display 45
Options
Screen Layout
WinSQL provides two different types of “views” (screen
layouts) when viewing queries:
• Integrated View
• Classic View
Important note:
For the purposes of this document, all procedural steps and
screen shots refer to the Integrated View. However, Classic
View screen shots are used in instances where they better
serve to illustrate the function being performed.
Integrated View
When using the Integrated View, WinSQL displays part
of the catalog screen next to the query window. This
allows you to quickly and conveniently see the tables,
views, and other objects in the database.
The Integrated View is depicted in the following screen
shot:
Classic View
Unlike the Integrated View, the Classic View does not
display the catalog screen. When in Classic View, you
must click the Catalog tab to view catalog details. An
advantage to using this view is that it provides more
room to display the query and results tabs.
The Classic View is depicted in the following screen
shot:
Switching Views
To switch between integrated and classic views, simply
click Switch to Integrated View or Switch to Classic
View from the View menu.
The text of the menu item changes based on the view
you currently are using.
Query Pages
A query page is a group of SQL scripts displayed on the
screen. You can have multiple query pages per window.
Creating multiple query pages helps you manage
queries when your SQL scripts get larger.
The first query page is created automatically when you
connect to a database. Thereafter, you have an option to
create as many query pages as you need. The number
of query pages allowed is limited only by available
memory on the machine.
To create a query page, point to the File menu, and then
click New Query Page. The number of the current query
page is displayed in the Available Query Pages field:
Using Clipboard
Results from queries can be copied to the Windows
Clipboard by pressing [Ctrl+C]. The information copied
to the Clipboard can then be copied into a variety of
other software applications, depending on the type of
output desired.
Convert to Code
This option allows you to write SQL code and convert
that code into a third-generation language, such as C-
Sharp, Visual Basic, or Java.
Perform the following steps to convert SQL code:
1 Right-click the desired script in the Query window,
and then click Extended Copy.
2 Click Convert to Code. The SQL2Code Wizard
window is displayed:
Copy to HTML
This option converts the SQL code into HTML, while
retaining all syntax highlighting, and provides a
convenient way of creating HTML documentation.
To copy SQL statements into HTML, right-click the
desired script in the Query windows, click Extended
Copy, and then choose HTML.
Printing Results
Results displayed in a Grid can be printed in three
different formats by right-clicking the displayed results,
and then clicking Print Results. A window similar to the
following is displayed:
After typing a title for your report in the Title field and
selecting the desired column width and color option,
select one of the available print format options, using the
information in the following table as a guideline:
Option Description
Tabular This option prints the data in a
format similar to a spreadsheet.
Pages are added sideways for
additional columns and
downward for additional rows.
This is the best option for printing
large amounts of data using the
least number of pages.
Option Description
Best fit This option allows a row of data
in a record to wrap to additional
lines, allowing multiple records to
be printed on each page.
This is the best option for viewing
multiple records in one page.
Intelli Tips
The Intelli Tips feature facilitates the writing of SQL
queries by displaying the catalog objects in a pop-up
window as the user types his/her queries.
Table Joins
WinSQL Professional recognizes relationships that are
specified on your back-end server using foreign key
constraints. In addition to foreign keys, you can also
create a local relationship among tables. For more
information, see “Creating Local Relationships” later in this
document.
Data Lookup
The Data Lookup feature in WinSQL Professional allows
users to view the actual values in the tables when writing
SQL queries. The value appears automatically when
WinSQL Professional detects a WHERE clause in the
query window, illustrated as follows:
Field Definition
Enable auto intelli If checked, Intelli Tips will be
tips displayed automatically as you
type your SQL queries.
Field Definition
From “dbo”.”customer”
When this is NOT checked,
WinSQL will only put quotes on
objects that have an embedded
space in their name.
Field Definition
types.
Drill-down Results
When you run a query from a single table that has
relationship, WinSQL Professional allows you to drill
down to related rows in the associated table.
Query History
WinSQL Professional keeps a history of queries you
have previously run. The default number of queries
stored is 50; however, this value can be changed by
clicking Configure on the History tab, and entering a
new value in Modify historic count option. In addition,
older queries are replaced by newer queries on a “first
in, first out” basic.
Historic queries can also be copied to disk for backup
purposes.
Parameter Queries
Beginning with WinSQL Professional version 2.0,
parameters can be accepted in queries. Any text that is
preceded by two colons (::) is considered a parameter,
and users are prompted to enter a value when the query
is run. In addition, WinSQL Professional stores the
values for previously-used parameters so that the user
does not have to type them every time.
Notes:
• Once a value has been specified for the first
parameter in a query, you can press [Enter] to move
to the next parameter. WinSQL Professional
attempts to determine the data type for the
subsequent parameters; however, the default data
type can be determined by selecting a type from the
list.
• Parameter queries cannot be used to export data.
SQL Wizard
The SQL Wizard, available in WinSQL Professional,
allows you to create SQL queries with the help of a
wizard, rather than creating queries by entering code. It
allows you to select the desired tables and fields, and to
apply filter conditions, before creating the SQL code for
you.
The SQL Wizard determines the referential integrity
constraints specified against any table and draw
appropriate relationships.
Note:
WinSQL Professional may not be able to determine
referential integrity constraints in certain case where
the ODBC driver does not provide necessary
information, such as drivers for Microsoft Access.
To activate the SQL Wizard, point to the Tools menu,
and then click SQL Query Wizard.
Overview
Introduction
This chapter provides information about customizable
configuration options available in WinSQL Professional.
In this chapter
This chapter contains the following topics:
General Tab
To access configuration options available on the
General tab, point to the Edit menu, and then click
Options. The General tab is displayed:
Option Description
# of records to return This parameter limits the number
from a query of records that are returned from a
SELECT statement. The default
value is -1, which indicates no
limit.
Option Description
Enable SQL 92 syntax If checked, the SQL Query Wizard
in query wizard will use SQL 92 syntax for JOIN.
Example: The following query is
written in traditional SQL
Select *
From Customers, Orders
Where Customers.id =
Orders.id
The same query can be written in
SQL 92 syntax as follows:
Select *
From Customers INNER JOIN
Orders ON Customers.id =
Orders.id
Option Description
Resultset Fonts
Option Description
Query terminator string This string breaks the script in
multiple parts, and each part is
sent separately to the database.
The default value for this
parameter is GO, and it works in
conjunction with the Terminator
must be on a new line and
Terminator string is case
sensitive configuration options.
Note:
Font and Size apply to the entire SQL script and are
not specific to any one element.
Make any desired changes, and then click OK.
Option Description
Backspace unindents Aligns the insertion point to the
previous indentation level
(outdents it) when [Backspace] is
pressed and when the cursor is on
the first nonblank character of a
line.
Option Description
Enable dragging Allows moving text by dragging it
to a new position.
Option Description
Max size for grid cell This is maximum size for a grid
cell before WinSQL will treat it as
long data. If the content length of
a cell exceeds this value, user
must click the “Zoom” icon to
view the entire data.
Buffer size for long data This option affects how large
data is inserted into the database
when user tries to copy contents
of a binary or large text file.
Since large files are sent in
chunks, this value specifies the
size of one chunk. Most likely
you should never have to change
this value.
Overview
Introduction
This chapter provides information scalar functions and
how to use them with WinSQL Professional.
In this chapter
This chapter contains the following topics:
Topic See
Page
Scalar Functions 72
String Functions 73
Numeric Functions 75
Time, Date, and Interval Functions 78
System Functions 81
Scalar Functions
In addition to supporting all functions supported by the
back-end database, WinSQL Professional also supports
ODBC scalar functions. In most cases, you will not need
to use scalar functions since the back-end database
usually has a richer set. However, in some cases, for
instance when the source is a text file, you will find these
functions extremely helpful.
Following are the types of scalar functions:
• String functions
• Numeric functions
• Time and date functions
• System functions
The syntax for using scalar functions is as follows:
{fn FUNCTION_NAME( PARAMETERS ) }
The string {fn MUST precede the function name and a
} must be followed after the close parenthesis.
Example:
select {fn SUBSTRING(first_name, 1, 3)}
FirstThree, first_Name
from customers
where cust_id = 1049
This query displays the following result:
FirstThree first_Name
---------- -------------------------
Den Denzil
1 Row(s) affected
The FirstThree field only displays the first 3 characters
of the name.
Important note:
Your driver may not support all of the functions listed
below. Check the driver help file for a detailed listing
of supported functions.
String Functions
Function name Description
ASCII(string_exp) Returns the ASCII code
value of the leftmost
character of string_exp as an
integer.
Numeric Functions
Function name Description
ABS(numeric_exp) Returns the absolute value of
numeric_exp
System Functions
Function name Description
DATABASE() Returns the name of the
database corresponding to the
connection.
Overview
Introduction
This chapter provides information about managing the
database catalog, including viewing, printing, and
applying filters.
In this chapter
This chapter contains the following topics:
Topic See
Page
About the Database Catalog 84
Catalog Caching 84
Enabling Catalog Caching 85
Viewing the Database Catalog 84
Exploring Objects in the Catalog 88
Providing Filters 88
Browsing Data 89
Using the Quick Math Feature 89
Applying Filters 89
Adding User Comments 90
Using the Insert/Update Record Wizard 94
Using Strings and Dates 94
Ignoring Fields and Null Values 95
Topic See
Page
Adding BLOB and CLOB Data 95
Managing Relationships 97
Creating Local Relationships 97
Deleting Relationships 99
Executing Stored Procedures 100
Using the New Table Wizard 101
Reverse Engineering a Table Design 102
Printing 103
Database Search Wizard 104
Using the Database Search Wizard 104
Notes:
• If Enable catalog caching is selected at
connection, WinSQL will load the catalog
immediately after connecting. Therefore, the
Load catalog after connection option on this
window is disabled.
• When the catalog is loaded from cache, the
word CACHED displays in the WinSQL status
bar:
Providing Filters
In some situations where the number of tables is very
large, it may take a long time to display all the tables and
their fields. The Catalog Details window provides two
filtering parameters that can restrict the total number of
objects displayed. These filters are:
• By user name - displays objects owned by this user
Browsing Data
Click the Browse Data node to browse the first few
records in a table or view. The default number of records
displayed is 100; however, this value can be changed in
the WinSQL Professional configuration options.
Tip:
Double-click the header of any row to sort the data
by that row.
Applying Filters
You can restrict the records that appear in the Browse
Data window by right-clicking and selecting Apply Filter
on the data grid. The following window is displayed:
ID INT 430
Note:
If any of the fields takes binary or long character
data, click the icon in the cell and select either
Load data from binary file or Load data from
text file.
Managing Relationships
WinSQL Professional exploits the foreign key constraints
defined between tables in the back-end database.
Several features, such as Intelli-tips Tips and Drill Down
results, depend on this information.
To manage relationships click on the Manage
Relationship node in the Catalog Details window,
depicted as follows:
Deleting Relationships
To delete a local relationship, access the Manage
Relationship window, right-click on a relationship line,
and then click Delete Relation.
To delete a remote relationship, you must write an
ALTER TABLE statement against your database.
Printing
The catalog information can be printed through the
printing wizard in WinSQL Professional. By answering
just a few questions, you can print the complete schema
of a database in matter of minutes.
Overview
Introduction
This chapter provides information using the Task
Scheduler to help automate routine database tasks.
In this chapter
This chapter contains the following topics:
Topic See
Page
About the Task Scheduler 107
Types of Tasks 107
Creating a Task to Run a SQL Script 108
Types of Tasks
Following type of tasks can be scheduled:
• Running SQL scripts
• Exporting data from one source to another target
• Exporting data to HTML files
• Running Data Diff and Schema Diff wizards
Field Description
Task Name Name for this task
server ( ).
For more information,
see “Configuring the
email server.”
Field Description
Attach output file in Click to select this option if
email you want to attach the output
file in the status e-mail.
Notes:
• Consult the Windows operating system
documentation or online help for further
information about scheduling tasks.
• Confirm the system date and time are
correct on your computer. Scheduled tasks
rely on this information to execute tasks on a
specified date and at a specified time.
Overview
Introduction
This chapter provides information about publishing SQL
query results to HTML pages.
Note:
You must be using WinSQL Professional version 3.0
or higher to use this functionality.
In this chapter
This chapter contains the following topics:
Topic See
Page
Using Export Templates 114
Creating a New HTML Template 114
Using an Existing HTML Template 117
Overview
Introduction
This chapter provides information about using the
database diff functionality to compare databases.
In this chapter
This chapter contains the following topics:
Topic See
Page
Database Diff Wizards 119
Schema Diff Wizard 119
Comparing Objects Using Schema Diff 124
Primary Objects and Detail Options 124
Data Diff Wizard 125
Comparing Objects Using Data Diff 128
Running Database Comparisons 129
Option Description
Object name comparison If selected, comparisons
Option Description
must be case sensitive are case sensitive.
selection icon .
WinSQL Professional User's Guide
February 2009 Release 7.5 127
Chapter 8: Using Database Diff WinSQL Professional User's Guide
Overview
Introduction
This chapter provides information about creating a test
environment by generating test data.
In this chapter
This chapter contains the following topics:
Topic See
Page
Creating a Test Environment 132
Starting the Test Data Generation 132
Wizard
Example scenario
In order to understand all the steps required to create
test data, the following example is provided, including
the steps used during the process.
The example scenario uses the following E-R diagram of
a database table:
String Formats
The following table specifies the rules for specifying
format for strings:
Keyword Description
/ Escape character
# Numeric values
Cached records
When records are read from either a table or text file,
WinSQL Professional reads a certain amount of rows in
the memory. These records are called cached records.
The default number of records in cache is 1000. Once
enough records are generated, the program discards all
the rows and refreshes the cache.
Ignoring a field
If you need WinSQL Professional to ignore a field for any
particular reason, simply double-click the column name
in the list box. This will cross out the field name and
display it in gray text.
Although ignoring a field is almost like setting the NULL
percentage to 100, there can be situations where they
can differ. Consider the following example:
You have a table that is defined as:
create table myTable(
id autoNumber primary key,
name varchar(30),
phone varchar(15)
)
Overview
Introduction
This chapter provides information about creating entity
relationship diagrams.
In this chapter
This chapter contains the following topic:
Topic See
Page
Creating an E/R Diagram 145
Icon Description
Add New Table - Click to display a list of Tables
and Views in your database. In the list that is
displayed, select and double-click a table to add it
in the diagram.
Overview
Introduction
This chapter provides information about exporting data
to different data sources.
In this chapter
This chapter contains the following topics:
Topic See
Page
Exporting Data 150
Exporting Data to Another Data Source 150
Connected 151
Disconnected 156
Text File
Topic See
Page
Importing a Delimited Text File 182
Importing a Fixed Width Text File 185
Command Line Options 178
Usage 190
Examples 190
Troubleshooting Common Problems 193
Exporting Data
WinSQL offers several ways to move data from once
source to another. For example, you can:
• Copy contents of one table to another table in a
different database
• Export data from table to a text file
• Import data from a text file to a database
• Generate INSERT INTO statements for an existing
data. These INSERT statements can later be run
against an empty table to insert data rows.
This section talks about different ways of importing and
exporting data from one source to another target in
WinSQL.
Export templates
Beginning with WinSQL Professional version 2.0, you
can create export templates files to use at a later date.
Additionally, these files are needed if you wish to run the
export routines from a command line.
Connected
Data can be exported from one table in the source
database to a target table or from an SQL query against
the source database to a target table.
The section below describes how to use Drag-N-Drop to
move contents of table from a source to a target:
1 Establish a connection between two databases. For
more information, see “Establishing a Database
Connection.”
2 Click the Catalog Details tab.
3 Click the plus sign by Tables in the source
database.
4 Click to select the desired table in the source
database.
5 While holding the left mouse button, drag the table
to the target database. This action is illustrated as
follows:
Note:
In the previous illustration, the rows that have
lines through them indicate that the columns be
ignored. In this example, the user does not wish
to export data for the “last_name” and “street”
columns.
9 Ensure the data mapping between the two
databases is correct, and then click Next. The
following window is displayed:
Disconnected
The disconnected export option uses DataBags to
complete the export. DataBags contain a local
representation of schema and data from a table in a
relational database. Using DataBags, WinSQL can
recreate a table along with its data. Therefore, DataBags
can be used for either database backup or to move data
from one source to another in a disconnected mode.
There are two ways to create DataBags: using table
drag-and-drop, or using WinSQL menu options. These
methods are described in the following sections.
Once the DataBag is created, perform the steps
described in this section to import the contents of the
DataBag into the target database.
Note:
It is not necessary at this point to connect to the
target database; the DataBag Export Wizard will
guide you through establishing the connection
during the data transfer.
2 From the Tools menu, point to Data To-Go, and
then click DataBags Viewer. The following window
is displayed:
5 Click Next.
6 Click Export to a new table in another database:
Note:
Seleting Export to a new table in another
database will prompt for the creation of an
ODBC Data Source pointing to your text file.
Creating a data source, rather than simply
10 Click Add.
11 Scroll through the list that is displayed, and select
WinSQL text file.
12 Click Finish.
13 Complete the fields as desired in the ODBC Text
Driver Setup window, and then click OK.
14 When the ODBC Data Source window is displayed,
click to select the newly-created text driver.
15 Click OK. The Data Export Wizard window is
displayed.
16 Modify the query as desired, and then click Next.
17 Modify the data mapping options as desired, and
then click Next.
18 Ensure the export summary information is correct,
and then click Finish.
Note:
If the export summary information is incorrect,
click Modify Query to make the necessary
changes.
The data export begins, and status information is
displayed during the process.
When the export has completed, the following
window is displayed:
Option Description
Replace with This is the default option and
CHAR(13) + will replace all new line
characters with an ODBC
CHAR(10) compliant function call.
Example: Let’s say a field
contains the following data.
Option Description
1 Main Street
Suite 130
This data will be converted to
'1 Main Street' + {fn
CHAR(13)} + {fn CHAR(10)} +
‘Suite 130’
Notice the {fn CHAR(13)}
statement, which represents
an ODBC escape sequence
for representing ASCII 13 and
10 characters.
Field Description
How do you want Replace a new line with
WinSQL to handle New CHAR(13) _ CHAR(10
Line characters? functions
Note: A new line character in the data
will be replaced by CHAR(13) +
These options define CHAR(10).
how “NEW LINE”
For example, if the data in the
characters appear in
database is:
your text file. Since every
record in the database “It is a nice day today”
appears in a line by itself, It will be converted to:
it is important to handle “It is a nice “ + CHAR(13) +
scenarios where a new CHAR(10) + “ day today”
line character appears in
the data itself. Print them as is
These options allow you No change will be made. You
to choose how to handle will see data in two lines.
them.
Ignore the rows with a
New Line character
Do not export rows that contain
a new line character
Field Description
Comment out the row with
a New Line character
Export the row but comment out
the query. You can later correct
the problem and re-run it.
Option Description
Executable Title Type a name to use as the title
for this EXE file. This name
Option Description
displays when the EXE file is
generated.
Note:
You can also invoke the Text Import Wizard by
opening Windows Explorer, navigating to and
selecting the text file you wish to import, and
then dragging it to the WinSQL Catalog window.
2 Click New.
3 Click Browse.
Note:
You may make changes to the field types or
lengths, but do not modify the table name.
14 If all field types and lengths are correct, click Next.
The following window is displayed:
15 Click Finish.
Note:
If you wish to save this import as a template,
either browse to or select an existing template
file, and then click Finish.
The data is imported, and a message similar to the
following is displayed:
Note:
You can also invoke the Text Import Wizard by
pointing opening Windows Explorer, navigating
to and selecting the text file you wish to import,
and then dragging it to the WinSQL Catalog
window.
2 Click New.
3 Click Browse.
4 Navigate to the location containing the text file you
wish to import, select the file, and then click Open.
5 Click Open.
6 Click Next.
7 Ensure the Fixed Width format is selected:
9 Click the green plug (+) icon to add fields from your
import file, and then specify the starting position for
each field added. Field lengths are automatically
calculated.
10 Once all fields have been selected, click Next. The
following window is displayed:
14 Click Finish.
Note:
If you wish to save this import as a template,
either browse to or select an existing template
file, and then click Finish.
The data is imported, and a message similar to the
following is displayed:
Usage
The syntax for running command line options is
described as follows:
WinSQL Professional <filename> | <option-
Value>
• filename: This is the name of a text file holding the
SQL script. This will just open the text file in the
editor but will not run it.
• option-Value: Using these pair of option-value,
you can run an SQL query against the database.
Refer the following table for a complete listing of the
options.
The following table describes of the available options:
Examples
Example 1
The following example shows how to run any SQL query
from the command line. It will open a file named
updateStudents.sql and connect to the database using
specified DSN, User Name, and Password. All error
messages or any output data will go to output.txt file,
and WinSQL Professional will close once the query has
completed.
WinSQL Professional "-dStudent DSN" –
uAdmin –pAdmin –qc:\updateStudents.sql –
oc:\output.txt -a
Example 2
The following example opens a file in the editor but does
not run it.
WinSQL Professional c:\student.sql
Example 3
Example 1
Example 2
Overview
Introduction
This chapter provides information about performing a
database backup and restore.
In this chapter
This chapter contains the following topics:
Topic See
Page
Backing Up a Database 195
Restoring a Database 197
Backing Up a Database
WinSQL offers an offline backup utility that can be used
in place of your native backup utility. One of the primary
advantages of using WinSQL’s backup utility is that it
offers the flexibility of backing up one type of database
and, if desired, restoring to a different type of database.
Additionally, WinSQL’s backup utility is always available
and is not dependent on outside resources, such as an
ISP backup service whose resources are shared by
many users.
Important note:
WinSQL’s backup utility is limited to backing up only
certain objects in the database, such as tables,
views, stored procedures, and triggers. Other
database-specific objects, such as user logins, user
defined data types, and sequences are not eligible
for back up.
Perform the following steps to back up a database:
1 Connect to the database you wish to back up. For
more information, see “Establishing a Database
Connection.”
2 From the Tools menu, point to Offline Backup,
and then click Backup. A window similar to the
following is displayed:
Restoring a Database
Perform the following steps restore a database:
1 Connect to the database you wish to back up. For
more information, see “Establishing a Database
Connection.”
2 From the Tools menu, point to Offline Backup, and
then click Backup. A window similar to the following
is displayed:
Overview
Introduction
This chapter provides information about using database
plug-ins.
In this chapter
This chapter contains the following topic:
Topic See
Page
Overview of Database Plug-Ins 202
The second image shows how the nodes in the tree are
reduced when a generic plug-in is used:
Overview
Introduction
This chapter provides information about running routine
administrative tasks, such as creating or rebuilding
indexes.
In this chapter
This chapter contains the following topics:
Topic See
Page
Wizards Used for Administrative Tasks 207
Available Wizards 208
Available Wizards
The following table describes some of the wizards
available in WinSQL Professional:
Wizard Description
Name
Create This wizard is invoked by selecting Create New
New Index from the drop down menu after clicking
Index Admin Tasks. Although this option is available for
most data sources, some back-end sources, for
example, TEXT driver, may not support it.
Plug-in enabled databases, such as Oracle, MS-
SQL Server, DB2, Sybase, Informix, Mimer,
PostgreSQL, MySQL and others use a database-
specific syntax for CREATE INDEX and support
extensions that are not available in other RDBMS.
For example, if you are connected to an MS-SQL
Server database, you can create a CLUSTERED
index.
Wizard Description
Name
scripts procedures. You can either select one object at a
time, or you can use the DDL Scripting wizard to
selectively pick the object.
To pick one table at a time, select the table from
Catalog Details window, and then click Generate
CREATE TABLE Statement.
Wizard Description
Name
Index
Revision History