Working with program

  1. Create/Open SQL project
  2. Data Tree window
  3. Save query
  4. Save a text of the SQL query into the file
  5. Connection of the kept queries to sources of the data
  6. Save a query with a new name
  7. Connection to sources of the data
  8. Add table to query
  9. Creation of connection between the tables in query
  10. Add of fields to query
  11. Creation of fields with conditions
  12. Viewing of result SQL of query
  13. Update resultset
  14. Creation of a condition WHERE in SQL query
  15. Creation of representation (View) on the basis of query
  16. Change of a mode viewing of result of performance SQL on the table of fields
  17. Making Having expression in group query
  18. Translate external SQL
  19. DELETE query
  20. OLAP Guide
  21. Exit from the program


Picture 1.

3. Save query.

In the main form (Pic.1) press the button (3). If the query already exists - operation is executed successfully. If it is new query - in the opened window of dialogue enter its name and press a key "OK".

4. Save a text of the SQL query into the file.

In the main form (Pic.1) press the button (4). In a new window of dialogue will choose a place on a disk and enter a name of a file for keeping. Press the button "OK".

5. Connection of the kept queries to sources of the data.

In the main form (Pic.1) press the button (5). In treelike structure located in area (1) basic forms, new unit with heading “Saved queries" will be added.

6. Save a query with a new name.

In the main form (Pic.1) press the button (6). In the opened window of dialogue enter its name and press a key "OK".

7. Connection to sources of the data.

First of all it is necessary to define a source (sources) given for SQL of query. For this purpose will press the button 8 (Pic.1). In the again opened form will choose OLE DB or ODBC provider. Specify a name of the user and if, it is necessary, password for input. A tag "Remember the password" always should be checked. Otherwise, the list of the tables will not be removed on the monitor. After that, in the left column of the main form you receive the list of accessible objects. To look the data it is possible, having allocated any name in column and having pressed right button at the mouse. Having repeated operation, it is possible to connect other sources necessary for construction of query. Let's notice, that the given operation can require what that time.

8. Add table to query.

Successfully having connected sources of the data, we shall define the list of the tables for construction SQL. For this purpose it is necessary to allocate the necessary line in the field of (Pic.1) main form and to drag it with the help of the mouse in area 2 on it. Repeating this operation it is possible to include in query any reasonable number of the tables (or representations). If you bring in one object more once, in the field of 2 it will occur under a pseudonym similar to the true name (For example: ShemaName.TableName. The first name in the field of 2 main form will be same, second TableName1, third TableName2 etc.). Then, it is necessary to keep query. It can be made with the help of the button 3 (Save) of the main form. As soon as the operation of preservation is carried out, there is an opportunity to include in query of a field from the chosen objects (area 3 picture 1).

9. Creation of connection between the tables in query.

In the field of 2 main forms will choose a pair of the tables for connection. On one of them allocate a field and press (letting off) the left button at the mouse. Then drag icon on the necessary field of the second table and release (let off) the button of the mouse. If connection is successfully created, the tables will be connected by line. If necessary to put down conditions on connection or to change its type, move the mouse on the communication line and press right mouse button. The menu with the list of possible actions will appear.

10. Add of fields to query.

For a choice of fields it is necessary, that at working area 2 main forms there was even one object (see item 2). Any field from the tables in the field of 2 can be included in inquiry. For this purpose it is necessary to allocate a field and drag by mouse to move it to area 3. After that in the table of fields (3) the new line with object chosen will appear earlier. Consistently repeating the stated above rules of filling of the table, it is possible to include all necessary fields for work.
Possible operations above fields in object (3):

11. Creation of fields with conditions.

Probably, you had to create queries, where meanings of a column in query were function of conformity of several parameters to the limited set of meanings on an output. For an example we shall take the table Products see the Table 1.
ProductID ProductName UnitPrice
1Ceylon Tee9
2Ceylon Tee extra15
3Brazilian coffee8
4Bolivian coffee30

Table 1.

Let it is necessary to create a query are dividing products into 3 kinds: 
	cheap coffee (UnitPrice < 10), road of coffee, cheap tea (UnitPrice < 1) expensive tea and other products. 
There are some ways of the decision, but most elegant is to create a field with conditions:
If ProductName like “ coffee ” and UnitPrice < 10 then CalcField = “Cheap coffee” If ProductName like “ coffee ” and UnitPrice >= 10 then CalcField = “Expensive coffee” If ProductName like “ Tee ” and UnitPrice < 10 then CalcField = “Cheap Tee” If ProductName like “ Tee ” and UnitPrice >= 10 then CalcField = “Expensive Tee” Else CalcField = “Other Product”.
The difficulty is, that on creation of a similar design in SQL query some time and, sometimes, essential efforts is required. VSD will allow you to make it much faster.


Picture 2.

Move the mouse to the table of fields (3) and click the right button. On the appeared menu will choose " Add CalcField ". On the opened form will choose a type of a created field with a condition and press "OK". In the table of fields the new line will appear, at which 9 ("Expression") the column has as against usual fields an emerald background. Move the mouse to there and also press left key. Before you the form (pic.2) - "Creation of fields with conditions" with the following sections will appear:
After creation of a field with conditions, to him is possible to apply the list of operations above fields (sorting, operation of summing).

12. Viewing of result SQL of query.

Previously generated query can be looked. For this purpose in the main form (Pic.1) press the button (9). Instead of the table of fields (3) the result of performance SQL will appear.

13. Creation of a condition WHERE in SQL query.


Picture 3.

For creation of conditions in query on the main form (Pic.1) press the button (11). The open form (Pic.3) has the title "Make the filter" and contains some areas:

14. Creation of representation (View) on the basis of query.

In the main form (Pic.1) press the button (12). In the opened window of dialogue enter a name of representation and press a key "OK". The note: If you work with RDBMS Access, at preservation of query the representation is created automatically.

15. Change of a mode viewing of result of performance SQL on the table of fields.

In the main form (Pic.1) areas (3) have some bookmarks. To receive the necessary information will choose the necessary bookmark and will click on it the left button of the mouse.

16. Exit from the program.

If you want to finish work with the program, in the main form (Pic.1) press the button (15).