Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Using sp_depends to
list dependent objects [Table of Contents] Chapter 10 Using the Built-In Functions
in Queries

Transact-SQL User's Guide

[-] Chapter 9 Views: Limiting Access to Data
[-] Getting information about views
[-] Listing all views in a database

Listing all views in a database

sp_tables lists all views in a database when used in the following format:

sp_tables @table_type = "'VIEW'"

Finding an object name and ID

The system functions object_id() and object_name() identify the ID and name of a view. For example:

select object_id("titleview")
----------
 480004741

Object names and IDs are stored in the sysobjects table.


Using sp_depends to
list dependent objects [Table of Contents] Chapter 10 Using the Built-In Functions
in Queries