查询Sybase ASE 对象如 tables, views, indexes, procedures, triggers, schemas, and users.
来源:互联网 发布:中国动画电影制作软件 编辑:程序博客网 时间:2024/05/16 08:34
查询Sybase objects such as tables, views, indexes, procedures, triggers, schemas, and users.
Tables and Views
To get all tables, views, and system tables, the following Sybase system stored procedure can be executed.
exec sp_tables '%'
To filter by database for tables only, for example master:
exec sp_tables '%', '%', 'master', "'TABLE'"
To filter by database and owner / schema for tables only, for example, master and dbo:
exec sp_tables '%', 'dbo', 'master', "'TABLE'"
To return only views, replace "'TABLE'" with "'VIEW'". To return only system tables, replace "'TABLE'" with "'SYSTEM TABLE'".
Owners
This is a query to get all Sybase owners.
select name from dbo.sysusers where uid < 16384 order by name
Procedures
This is a query to get all Sybase procedures.
exec sp_stored_procedures '%'
The query can be filtered to return procedures for specific owners and databases by appending more information onto the procedure call, such as the following:
exec sp_stored_procedures '%', 'dbo', 'master'
Procedure Columns
This is a system stored procedure call to get the columns in a Sybase procedure.
exec sp_sproc_columns 'get_employee_names', 'dbo', 'sample'
Triggers
This is a query to get all Sybase triggers.
select * from sysobjects where type = 'TR'
The query can be filtered to return triggers for a specific owner by appending a user_name call onto the where clause to the query.
select * from sysobjects where type = 'TR' and user_name(sysobjects.uid) = 'dbo'
Indexes
This is a query to get Sybase indexes for a particular table. In this example, the table used is employee.
exec sp_helpindex 'employee'
转自:http://razorsql.com/articles/sybase_admin_queries.html
- 查询Sybase ASE 对象如 tables, views, indexes, procedures, triggers, schemas, and users.
- Which three statements are correct about temporary tables? (Choose three.) A. Indexes and views can
- 18 Partitioned Tables and Indexes
- Stored procedures 1: Find columns and tables
- Stored procedures: Find columns and tables
- Objects: Tables, Views and others
- Objects: Tables, Views and others
- Objects: Tables, Views and others
- System catalog tables and views
- 3 Indexes and Index-Organized Tables读书笔记
- Using DataAdapters and stored procedures with Sybase and ODBC.NET
- setup db and users for sybase
- Professional SQL Server 2005 CLR Programming: with Stored Procedures, Functions, Triggers, Aggregates and Types
- Stored Procedures, Triggers And User Defined Functions on DB2 Universal Database for Iseries
- Sybase ASE 查询当前版本和所有数据库
- linux Sybase ASE 查询当前版本和所有数据库
- Partitioned Tables and Indexes in SQL Server 2005
- Partitioned Tables and Indexes in SQL Server 2005 (EN原版)
- python 使用list和tuple
- UITextField
- 二叉树的非递归遍历
- PAT (Basic Level) Practise (中文)1005. 继续(3n+1)猜想 (25) C语言
- GCD深入理解(二)
- 查询Sybase ASE 对象如 tables, views, indexes, procedures, triggers, schemas, and users.
- 决策树算法---java
- 解决 eclipse 新建 maven 后无法显示 src/main/java 和 src/main/test
- 【j2ee spring】46、巴巴运动网——购物车
- 利用SQL索引提高查询速度
- Algorithms—172.Factorial Trailing Zeroes
- [高可用]Ubuntu搭建高可用的RabbitMQ(1)
- Java的内存机制
- block没那么难(一)