Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - SQL Usage » Designing and Creating Databases » Working with database objects » Introduction to working with database objects

 

Viewing system objects in a database

SQL Anywhere provides many system objects such as system tables, system views, stored procedures, and domains. These objects hold information about database objects, and how they are related to each other. System views, procedures, and domains largely support Sybase Transact-SQL compatibility.

To display system objects in a database (Sybase Central)

  1. Start the database server.

  2. Connect to a database as a user with DBA authority.

  3. Choose File » Configure Owner Filter.

  4. Select SYS, and dbo, and then click OK.

To browse system objects (SQL)

  1. Connect to a database.

  2. Execute a SELECT statement, querying the SYSOBJECT system view for a list of objects.

Example

The following SELECT statement queries the SYSOBJECT system view, and returns the list of all tables and views owned by SYS and dbo. A join is made to the SYSTAB system view to return the object name, and SYSUSER system view to return the owner name.

SELECT b.table_name "Object Name", 
      c.user_name "Owner", 
      b.object_id "ID", 
      a.object_type "Type", 
      a.status "Status"
  FROM ( SYSOBJECT a JOIN SYSTAB b 
         ON a.object_id = b.object_id ) 
  JOIN SYSUSER c
WHERE c.user_name = 'SYS' 
   OR c.user_name = 'dbo'
ORDER BY c.user_name, b.table_name;
See also