Get the App
SLTechnology News&Howtos  ›  Database  › 

Use SQL to query table information in Sybase ASA 12

Shulou Source: shulou.com Published: 2022-06-01 22:39:19 10月03日 Update

In the Sybase central tool, we can often see the following pages:

Yesterday, a customer happened to need to export such a copy of table data, so I wrote the following SQL statement to query table information:

SELECT tbl.table_name AS "Name", usr.user_name AS "Owner", 'Table' AS Type,-- because the information is queried for Table, not View, the data in the Type column is always' Table' Here is the hard code remarks AS "Comment" FROM sys.SYSTABLE AS tblLEFT JOIN sys.SYSUSER AS usr ON usr.user_id = tbl.creatorWHERE creator IN (SELECT creator FROM sys.SYSTABLE WHERE table_name='zip2kv'-- We know the name of one of the tables, so just query systable directly, otherwise you'll have to look up the db table)

What's written on this pile? The picture was lost by 51CTO. After such a long time, I don't even know what to write. Let's sort it out, maybe it's of some reference value.

The Sybase ASA 12 database contains system tables that record the Meta information in the business database (the database that the user needs to create because of the business). For example, all database names that exist on the current Sybase ASA are recorded in the system's db table. Sys.SYSTABLE, as its name implies, means that SYSTABLE system tables hold relevant definition information about all the tables in the Sybase ASA database management system. Almost all the Meta information you can use is recorded in the system table with sys as the schema. As long as you look through the corresponding Sybase ASA documents, you should be able to find the information you want.

Tags: Data information system database query business as the name implies value name customer that is tools documents users management systems statements pages thoughts names references Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Linux Huawei Docker vpn