Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Albert Rognan: "Thank you for this quick reply. I must say I am impressed of the number of functions that is available within this tool".
Alex Torin: "Several months ago I downloaded the trial versions of several Microsoft SQL administration tools that I was able to find using google. I had considerable trouble with most of them crashing... but using your product I was able to isolate and solve the problems I was having. I decided to add it to my toolkit and have recommended it to a few others".

More

Add your opinion

MS SQL Maestro online Help

Prev Return to chapter overview Next

Create View Wizard

Create View Wizard guides you through the process of creating a new view. See How To Create View to learn how to run this wizard.

 

The basic principles of Create Object Wizards in MS SQL Maestro are explained in a separate topic. Below you will find a description of wizard steps that are unique for the current object.

 

Selecting fields for a new view

Select a table or a view from the Based on drop-down menu. Then specify which fields will be used in the new view. Use Add All or Add Selected buttons to include field(s) into view definition. Use the Remove Selected or Remove All items to exclude field(s) from the view's field list. Click the Next button to proceed.

 

 

Specifying view options

Name

You may specify here the name of the view being created.

 

Owner

Defines the owner of the new view. By default, only the owner of an object can perform various operations with the object. In order to allow other users to operate it, privileges must be granted. (However, users that have the superuser attribute can always access any object.)

 

Comment

The box allows you to set optional text describing the view.

 

Schema Binding

Binds the view to the schema of the underlying table (or tables). If checked, the base table (or tables) cannot be modified in a way that would affect the view definition. All the referenced objects must be in the same database.

 

With Check Option

Forces all data modification statements executed against the view to follow the criteria set within the select statement. When a row is modified through a view, the With Check option ensures the data remaining visible through the view after the modification is committed. To check the option the owner of the view table must have been granted the INSERT, UPDATE, or DELETE privilege for the view table.

 

View Meta Data

Specifies that the instance of SQL Server will return to the DB-Library, ODBC, and OLE DB APIs the metadata information about the view, instead of the base table or tables when browse-mode metadata is being requested for a query that references the view. If checked, the browse-mode metadata returns the view name and not the base table names when it describes columns from the view in the result set.

 

Specifying the WHERE condition

MS SQL Maestro provides the Filter Builder dialog to facilitate a creating of the WHERE condition.

 

 

Suppose we need to select orders from the sample table Orders made between 01.02.2010 and 10.02.2010. These criteria are applied to the OrderDate column. Press the button to add this condition. Alternatively, you can use the Filter button and select the Add Condition option from the drop-down menu.

 

 

 

 

Select the OrderDate column in the drop-down list of the available columns.                                                                                                                                                      

 

 

 

 

Set the proper operator. In our example it is BETWEEN.                                                                                                                                                                                  

 

 

 

 

Next, you need to specify the range values for the selected operator. The editor used in value boxes is determined by the editor type assigned to the corresponding column.

 

 

Now use the Apply button to see the filter result.

 

You can add additional conditions to the same root level to be combined by the AND operator.

 

 

Suppose we need to select orders made between 01.02.2010 and 10.02.2010 and payed via 'Visa' or 'American Express'. This is a complex filter condition combining two simple conditions with the OR operator. Conditions from the same root level are combined by the AND operator. To add a condition combined with the previous one with the OR (NOT AND, NOT OR) operator, use a new group of conditions.

 

 

The next screen represents the finished filter conditions for this example.

 

Adding view subitems

On this step of the wizard you can specify subobjects of the new view.

To add a new object:

 

Choose a necessary page (Triggers - to manage view triggers, CLR Triggers - to manage view CLR triggers);
Press Insert or use pop-up menu to open the appropriate Create Object Wizard (triggers, or CLR triggers);
Specify new object properties.

 

 



Prev Return to chapter overview Next