sp_iqview Procedure

Displays information about views in a database.

Syntax 1

sp_iqview ([view_name],[view_owner],[view_type])

view_type:
    SYSTEM
   | ALL
   | any_other_value

Syntax 2

sp_iqview [view_name='viewname'],
[view_owner='viewowner' ],[view_type='viewtype' ]

Parameters

Privileges

You must have EXECUTE privilege on the system procedure.

Remarks

For Syntax 1, sp_iqview NULL,NULL,SYSTEM, if you do not specify either of the first two parameters, but do 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'.

Note: The view_type value ALL must be enclosed in single quotes in Syntax 1.

For Syntax 2, the parameters can be specified in any order, enclosed in single quotes.

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.

sp_iqview columns

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.

Related reference
sp_iqcolumn Procedure
sp_iqconstraint Procedure
sp_iqdatatype Procedure
sp_iqevent Procedure
sp_iqhelp Procedure
sp_iqindex and sp_iqindex_alt Procedures
sp_iqpkeys Procedure
sp_iqprocparm Procedure
sp_iq_reset_identity Procedure
sp_iqtable Procedure
Determining the Security Model Used by a Database