In DatabaseSpy you can view properties by selecting objects in (i) the Project window, (ii) the Online Browser, or (iii) the Design Editor. In addition, you can define properties for designs and SQL files that have been added to a project. The properties are displayed in the Properties window.
Changing a property in the Property Window or in the Design Editor automatically generates an SQL change script which appears in the in the Database Structure Change Script window either automatically or after you have clicked the Update Change Script button, depending on how you have configured the Change Script options. Properties that cannot be edited are grayed out.
In the Online Browser, properties for all database objects as well as for any active data source connection, its database and/or schema(s) can be viewed in the Properties window. When folders are displayed, clicking a folders shows an overview of the folders content in the Properties window.
The properties that are displayed in the Properties window depend on the database object that is currently selected in the Online Browser or Design Editor window. If an object has child objects, the content of the Properties window changes in accordance with the level to which you expand the object, that is, only properties for expanded items are displayed in the Properties window.
For the data source connection, DatabaseSpy displays the same properties like in the Project window. The properties that are displayed when you click on a database in the Online Browser are for information purposes only and cannot be changed.
For every database object that contains child objects, an overview section is displayed. This section provides hyperlinks for counting the number of the individual children of the database object as well as a hyperlink for counting all children of the object. Note that the count is retrieved automatically if you expand the object in the Online Browser or show a table in the Design Editor.
To retrieve the number of child objects in the Overview section of the Properties window, you have therefore the following options:
•Click the "Update all Counts" hyperlink to retrieve the count for all child objects.
•Click the "Update Count" hyperlink for an individual database object to retrieve the count for this specific item.
•Show a table in the Design Editor; this automatically retrieves the count for all child objects of the table.
•Right-click a table and select Expand | Children from the context menu. This expands all sub-folders of the table in the Online Browser and thus shows the number of child objects in the table properties.
•Expand one or more sub-folders in the Online Browser and then click the table again. The number of items contained in the folder is displayed in the table properties.
Table properties can be viewed (i) in the Properties window and (ii) to some extent in the table design. If properties are displayed in the Properties window, it makes no difference whether a database object is selected in the Online Browser or in the Design Editor.
The Overview section lists the child objects of the table and you can retrieve the number of the individual children separately. In the Constraints section, you can see at a glance which constraints are defined on which columns for the table. Check Constraints on table level can even be edited in this section. Whereas the General section provides only read-only information, you can enter a new or change an existing description for the table in the Description section.
A table may contain the following sub-folders:
When you expand the Columns sub-folder under a table in the Online Browser or expand the Columns section in a table design in Design Editor, and select a column, the column properties are displayed in the Properties window. Here you can change the data type and the Nullable property in the General section, or enter a description in the Description section. The remaining sections (Overview and Advanced) are read-only.
The constraints properties for check constraints include the name of the table the constraint is assigned to, the expression used for the constraint, and a description. You can change the expression and the description in the Properties window.
If you select a primary or unique key in the Online Browser or in the Design Editor, the Properties window displays the number of columns that are used to build the key as well as the table the key is assigned to. For foreign keys, also the referenced tables and columns as well as the action on delete and update are displayed in the properties.
Index properties show information such as the number of columns involved, index type, and the column name an index is assigned to. The Options section provides additional read-only information.
In the properties for views, DatabaseSpy displays the number of columns that are included in the view (provided that the object count has been retrieved), and the schema in which the view is defined. The Advanced section shows additional read-only information.
The only option that you can change directly in the Properties window for XML schemas is the Decomposition check box. Any other property is read-only in the Properties window and can only be changed in the XML Schema management for databases dialog box.
For procedures, only the number of parameters and the schema in which the procedure is defined are displayed in the Properties window. If you expand a procedure to show the parameters, you can also display the data type and the direction mode of a parameter in the Properties window. All properties for procedures are read-only.
The properties displayed for functions include the number of parameters, the schema, the Deterministic check box, and the language. If you expand a function to show the parameters, you can also display the data type and the direction mode of a parameter in the Properties window. All properties for functions are read-only.
|Note:||The constraints information can only be displayed if all the table's children objects have already been loaded. This can be achieved in one of the following ways:|
•by expanding the table in the Online Browser
•by generating an SQL statement for that table in the SQL Editor
•by showing the table in the Design Editor
Changing table properties
All the table and columns properties that can be edited can be changed either in the Properties window of the Online Browser or in the property window in the Design Editor. In the table display in the Design Editor, you can also edit the data type or check or uncheck the Nullable check box.
To change the properties of a column:
1.Do one of the following:
•In the Online Browser, select a column and change its properties in the Properties window of the Online Browser.
•In a Design Editor window, select a column name, click the ball at the right edge of the table display and change the properties in the property window that appears.
The changed column icon appears to the left of the column name and the changed table icon appears to the left of the table name.
2.If applicable, click the Update Change Script button to update the change script.
3.In the Database Structure Change Script window, click the Execute Change Script button.