Displays information about views in a database.
DBA authority required. Users without DBA authority must be granted EXECUTE permission to run the stored procedure.
sp_iqview NULL,NULL,SYSTEM
If you do not specify either of the first two parameters, but specify the next parameter in the sequence, you must substitute NULL for the omitted parameters. For example: sp_iqview NULL,NULL,SYSTEM and sp_iqview deptview,NULL,'ALL'.
The parameters can be specified in any order. Enclose them in single quotes.
The allowed values for the view_type parameter:
view_type value |
Information displayed |
---|---|
SYSTEM |
System views |
ALL |
User and system views |
any other value |
User views |
Specifying one of the parameters returns only the views with the specified view name or views that are owned by the specified user. Specifying more than one parameter filters the results by all of the parameters specified. Specifying no parameters returns all user views in a database.
Column name |
Description |
---|---|
view_name |
The name of the view |
view_owner |
The owner of the view |
view_def |
The view definition as specified in the CREATE VIEW statement |
remarks |
User comments added with the COMMENT statement |
sp_iqview returns a view definition greater than 32K characters without truncation.