Tasks D-L


Designing a table and related objects -- general procedure

Creating a table usually also requires creating indexes, defaults, rules, user-defined datatypes, triggers, and views. For greater efficiency, design a table and all its components at once.

To design a table

  1. Decide what columns you need in the table, and the datatype, length, precision, and scale, for each.
  2. Decide which column, if any, should be the IDENTITY column.
  3. Decide which columns should accept null values.
  4. Decide what integrity constraints or column defaults, if any, you need to add to the columns of the table. Also decide when to use column constraints and defaults instead of defaults, rules, indexes, and triggers to enforce data integrity.
  5. Decide whether you need defaults and rules, and if so, where and what kind. Consider the relationship between the NULL and NOT NULL status of a column and defaults and rules.
  6. Decide what kind of indexes you need and where you want them.
  7. Create user-defined datatypes before you create the table.
  8. Create the table and its indexes.
  9. Create new defaults and rules you need.
  10. Bind any defaults and rules you need. If there were any defaults or rules on a user-defined datatype that you used in a column definition, they are automatically in force.
  11. Create triggers.
  12. Create views.

Choosing columns that accept NULL values

Every column has an explicit NULL or NOT NULL entry, except columns that are assigned user-defined datatypes. NOT NULL is the default; therefore, you do not need to specify it in the table definition. The NOT NULL default means that some entry is required.

You cannot use NULL with bit columns.

If a column is designated NULL and a default is bound to it, the default value, rather than NULL, is entered when no other value is given on input.

If a column is designated NULL and a rule is bound to it that does not specify NULL, the column definition overrides the rule when no value is entered for the column. Columns can have both defaults and rules.

Choosing index columns

You can specify two or more columns as index columns. These columns, together with the sensitivity column, form a composite index on the combined values of the columns. Composite indexes are used when two or more columns are best searched as a unit.

When you specify the columns, list all the columns in sort-priority order. The columns in a composite index do not have to be in the same order as the columns in the table.

You can combine up to 16 columns into a single composite index. All the columns in a composite index must be in the same table. The maximum allowed size of the combined index values is 256 bytes. That is, the sum of the lengths of the columns that make up the composite index cannot exceed 256.

Return to the list of tasks.

Deleting

To delete an ASE Replicator connection

  1. Select a primary Adaptive Server in the left pane.
  2. Open the ASE Replicator folder under the primary Adaptive Server.
  3. In the right pane, right-click the icon of the connection you want to delete.
  4. Select Delete.
  5. Click Yes in the Question dialog box.

You cannot delete an ASE Replicator connection that has any publication or subscription defined in it.

Return to the list of tasks.

 

To delete an ASE Replicator primary article

  1. Select a primary Adaptive Server in the left pane.
  2. Open the ASE Replicator folder under the primary Adaptive Server.
  3. Select a primary connection under the ASE Replicator folder.
  4. Select a publication under the primary connection.
  5. In the right pane, right-click the icon of the article you want to delete.
  6. Select Delete.
  7. Click Yes in the Question dialog box.

You cannot delete an ASE Replicator primary article that has any replicate articles subscribing to it.

Return to the list of tasks.

 

To delete an ASE Replicator publication

  1. Select a primary Adaptive Server in the left pane.
  2. Open the ASE Replicator folder under the primary Adaptive Server.
  3. Select a primary connection under the ASE Replicator folder.
  4. In the right pane, right-click the icon of the publication you want to delete.
  5. Select Delete.
  6. Click Yes in the Question dialog box.

You cannot delete an ASE Replicator publication that has any articles defined in it, or any subscriptions that subscribe to it.

Return to the list of tasks.

 

To delete an ASE Replicator replicate article

  1. Select a primary Adaptive Server in the left pane.
  2. Open the ASE Replicator folder under the primary Adaptive Server.
  3. Select a replicate connection under the ASE Replicator folder.
  4. Select a subscription under the replicate connection.
  5. In the right pane, right-click the icon of the article you want to delete.
  6. Select Delete.
  7. Click Yes in the Question dialog box.

Return to the list of tasks.

 

To delete an ASE Replicator subscription

  1. Select a primary Adaptive Server in the left pane.
  2. Open the ASE Replicator folder under the primary Adaptive Server.
  3. Select a replicate connection under the ASE Replicator folder.
  4. In the right pane, right-click the icon of the subscription you want to delete.
  5. Select Delete.
  6. Click Yes in the Question dialog box.

You cannot delete an ASE Replicator subscription that has any articles defined in it.

Return to the list of tasks.

 

To delete a cache

  1. Open the Caches folder.
  2. Select the caches you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a check constraint

  1. Open the Check Constraints folder.
  2. Select the check constraints you want to delete.
  3. Choose File | Delete.

To delete a unique constraint

  1. Open the Unique Constraints folder.
  2. Select the unique constraints you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a column from a table

  1. Select the column you want to delete.
  2. Choose File | Delete.

Return to the list of tasks.

To delete a database

  1. Open the Databases folder.
  2. Select the databases you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a database device

  1. Open the Database Devices folder.
  2. Select the devices you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a user-defined datatype

Before you delete an object, check its dependencies to make sure that other objects do not refer to it. If you delete an object that another object depends on, errors can occur.

Note: You cannot delete a user-defined datatype that is being used by columns in the database.

  1. Open the User-defined Datatypes folder.
  2. Select the types you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a default

Before you delete an object, check its dependencies to make sure that other objects do not refer to it. If you delete an object that another object depends on, errors can occur.

  1. Open the Defaults folder.
  2. Select the defaults you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a dump device

  1. Open the Dump Devices folder.
  2. Select the devices you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete an engine group

  1. Open the Engine Group folder.
  2. Select the engine groups you want to delete.
  3. Choose File | Delete.

Note: You cannot delete the default engine groups ANYENGINE and LASTONLINE.

Return to the list of tasks.

To delete an execution class

  1. Open the Execution Class folder.
  2. Select the execution classes you want to delete.
  3. Choose File | Delete.

Note: You cannot delete the execution classes EC1, EC2, and EC3.

Return to the list of tasks.

To delete an extended stored procedure

  1. Open the Extended Stored Procedure folder.
  2. Select the extended stored procedures you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a foreign key

  1. Open the Foreign Keys folder.
  2. Select the foreign key you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a group

Before deleting a group, you must remove all users from the group.

  1. Open the Groups folder.
  2. Select the groups you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete an index

  1. Open the Indexes folder.
  2. Select the indexes you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a login

Before you delete a login, do the following for each user with whom the login is associated:

You may want to consider disabling the login by locking it rather than deleting it.

Note: You cannot delete a login if it is used by a user in any database. However, you can lock the login to prevent it from being used.

  1. Open the Logins folder.
  2. Select the logins you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete an object

Before you delete an object, check its dependencies to make sure that other objects do not refer to it. If you delete an object that another object depends on, errors can occur.

  1. Select the object and choose File | Delete.
  2. Confirm the deletion.

Return to the list of tasks.

To delete a user-defined role

  1. Open the Roles folder.
  2. Select the user-defined roles you want to delete.
  3. Choose File | Delete.

Note: You cannot delete a system role.

To delete a remote server

  1. Open the Remote Servers folder.
  2. Select the remote servers you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a rule

Before you delete an object, check its dependencies to make sure that other objects do not refer to it. If you delete an object that another object depends on, errors can occur.

Note: You cannot delete a rule that is bound to columns or user-defined datatypes in the database.

  1. Open the Rules folder.
  2. Select the rules you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a segment

Note: You cannot delete a segment that has been assigned to a table or index.

  1. Open the Segments folder.
  2. Select the segment you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a stored procedure

Before you delete an object, check its dependencies to make sure that other objects do not refer to it. If you delete an object that another object depends on, errors can occur.

  1. Open the Stored Procedures folder.
  2. Select the procedures you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a table

Before you delete an object, check its dependencies to make sure that other objects do not refer to it. If you delete an object that another object depends on, errors can occur.

Note: You cannot delete a table while it is in use (being read or written to).

  1. Open the User Tables folder.
  2. Select the tables you want to delete.
  3. Choose File | Delete. This removes the specified tables from the database, together with their contents and all the indexes and privileges associated with them. Rules or defaults bound to the table are no longer bound, but are otherwise not affected.

Return to the list of tasks.

To delete a trigger

  1. Open the Triggers folder.
  2. Select the triggers you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a user

Before you delete a user:

  1. Open the Users folder.
  2. Select the users you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To delete a view

Before you delete an object, check its dependencies to make sure that other objects do not refer to it. If you delete an object that another object depends on, errors can occur.

  1. Open the Views folder.
  2. Select the views you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To disable disk mirroring

  1. Open the property sheet for the database device from which you want to remove mirroring.
  2. Select the Mirror tab.
  3. Select the Disable/Remove Mirror check box.
  4. For Device, specify the device you want to disable.
  5. For Action, select Disable Temporarily.

Return to the list of tasks.

To disconnect from Adaptive Server

  1. Select the Adaptive Server you want to disconnect from.
  2. Choose File | Disconnect.

Killing server processes of users also disconnects the users from Adaptive Server.

Return to the list of tasks.

Displaying

To display the code of a stored procedure, trigger or view

  1. Select the procedure, trigger, or view.
  2. Choose File | Generate DDL. The code is displayed in the code editor.

Note: You cannot change the code of an existing stored procedure, trigger, or view. To make changes, copy the code and use it as the basis for the updated stored procedure, trigger, or view. Delete the original object.

Return to the list of tasks.

To display objects

  1. Navigate the left panel object hierarchy to the object type you want to display.
  2. Select the folder for that object. The objects of that type are displayed in the right panel.

Return to the list of tasks.

To display the properties of Adaptive Server

  1. Select the icon of the connected Adaptive Server.
  2. Choose File | Properties.

Return to the list of tasks.

To display the properties of an object

  1. Open the folder for the type of object whose properties you want to display.
  2. Select the object whose properties you want to display.
  3. Choose File | Properties.

Return to the list of tasks.

To display the space available for transaction logs

  1. Select the icon for Adaptive Server.
  2. Choose File | Log Space.

Return to the list of tasks.

Editing

To edit columns

  1. Select the table that contains the column you want to edit.
  2. Choose File | Edit Table.
  3. In the table editor, select the column you want to edit.
  4. Click on a property to edit it. Some properties cannot be changed.
  5. To edit other properties of the column, select the column and choose File | Properties, or click the Advanced Column Properties toolbar button.

You can also examine and edit columns from the table's Columns folder.

Return to the list of tasks.

To edit DDL scripts

  1. Save generated DDL scripts as text files.
  2. Edit the files using an ASCII text editor.

Return to the list of tasks.

To edit a group's object permissions

  1. Open the property sheet for the group.
  2. Click the Object Permissions tab.
  3. Select the type of object to show permissions for (tables, views, extended stored procedures, or procedures).
  4. For a particular object, click the cell for a type of permission to cycle through the valid settings.

Return to the list of tasks.

To edit a primary key

  1. Open the table in the table editor. Columns that are part of the primary key are indicated by a key icon for the Key property.
  2. Click the key icon to remove the primary key from the column.

Note: Primary keys are also shown in the Columns folder of the table.

Return to the list of tasks.

Editing properties

To edit the properties of a cache

  1. Select the cache you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a check constraint

  1. Select the check constraint you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Note: The only property you can change for the constraint is its name. To change other properties, you must delete and re-create the constraint.

Return to the list of tasks.

To edit the properties of a column

  1. Select the column you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Note: You can also edit columns in the table editor.

Return to the list of tasks.

To edit the properties of a database

  1. Select the database you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a database device

  1. Select the database device you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a default

  1. Select the default you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Note: The only property you can change for the default is its name. To change other properties, you must delete and re-create the default.

Return to the list of tasks.

To edit the properties of an engine group

  1. Select the engine group you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Note: You cannot edit the properties of the default engine groups: ANYENGINE and LASTONLINE.

Return to the list of tasks.

To edit the properties of an execution class

  1. Select the execution class you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Note: You cannot change the priority or engine group of EC1, EC2, or EC3. You can change the bindings of these execution classes.

Return to the list of tasks.

To edit the properties of an extended stored procedure

  1. Select the extended stored procedure you want to edit.
  2. Choose File | Properties.
You can change the name of the DLL or you can edit the permissions.

Note: If you want to add parameters to an extended stored procedure, generate DDL for the procedure, then edit the DDL.

Return to the list of tasks.

To edit the properties of a foreign key

  1. Select the foreign key you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Note: The only property you can change for the foreign key is its name. To change other properties, you must delete and re-create it.

Return to the list of tasks.

To edit the properties of a group

  1. Select the group you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of an index

  1. Select the index you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a login

  1. Select the login you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of an Adaptive Server process

  1. Select the process you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

You can change the execution attributes of a process.

Return to the list of tasks.

To edit the properties of a remote server

  1. Select the remote server you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a role

  1. Select the role you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a rule

  1. Select the rule you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Note: The only property you can change for the rule is its name. To change other properties, you must delete and re-create it.

Return to the list of tasks.

To edit the properties of a segment

  1. Select the segment you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a stored procedure

  1. Select the procedure you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a table

  1. Select the table you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a trigger

  1. Select the trigger you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Note: The only property you can change for the trigger is its name. To change other properties, you must delete and re-create it.

Return to the list of tasks.

To edit the properties of a unique constraint

  1. Select the unique constraint you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a user

  1. Select the user you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a user-defined datatype

  1. Select the user-defined datatype you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To edit the properties of a view

  1. Select the view you want to edit.
  2. Choose File | Properties.
  3. Edit the properties.

Return to the list of tasks.

To execute DDL scripts

Do one of the following:

Return to the list of tasks.

To extract a JAR file from a database to your file system

You must have read permission on the sysxtypes and sysjars tables to perform this procedure.

  1. Open the Java Objects folder in the table that contains the JAR file you want to extract.
  2. Open the JAR Files folder.
  3. Select the JAR file you want to extract.
  4. Choose File | Extract.

Return to the list of tasks.

To generate DDL for an object

  1. Select the object for which you want to generate DDL.
  2. Choose File | Generate DDL.

The generated DDL statement is shown in the tools console. You can save it to a file.

To generate DDL for all objects in a database:

  1. Select a database.
  2. Choose File | Generate Database Objects DDL.

DDL for each object in the database is shown in the tools console. You can save it in a file.

Return to the list of tasks.

To kill (delete) processes on Adaptive Server

WARNING: Killing server processes of users disconnects the users from Adaptive Server.

  1. Open the Processes folder.
  2. Select the process you want to delete.
  3. Choose File | Delete.

Return to the list of tasks.

To lock or unlock logins for Adaptive Server

  1. Open the Logins folder.
  2. Display the properties sheet for the login.
  3. Click the Parameters tab.
  4. Under Account Status, click Account is locked. A checkmark indicates that the account is locked.

Return to the list of tasks.

 

Continue to Tasks M-R