...the SQL Query Tool that was designed with you in mind
Get Productive Today!
Home | Product Features | Screenshots | Videos | Download\Purchase | Support Forum | About

Query Your Database for a List of Views

The following SQL can be used to query your database system tables for a list of views. With the exception of Oracle, each query returns the view name with the appropriate schema\owner name appended to it. Oracle simply returns the name of the view.

Sybase ASE

SELECT b.name + '.' + a.name
  FROM sysobjects a, sysusers b
 WHERE a.type = 'V'
   AND a.uid = b.uid
 ORDER BY a.name

Oracle

SELECT OBJECT_NAME
  FROM all_objects
 WHERE owner = :sOwner
   AND object_type = 'VIEW'

SQL Server

IF OBJECT_ID('sys.schemas') IS NULL
    SELECT B.name + '.' + A.name
      FROM sysobjects A, sysusers B
     WHERE A.type = 'V'
       AND B.uid = OBJECTPROPERTY ( A.id , 'ownerid' )
     ORDER BY A.name
ELSE
    SELECT B.name + '.' + A.name
      FROM sysobjects A, sys.schemas B
     WHERE A.type = 'V'
       AND B.schema_id = A.uid
     ORDER BY B.name + '.' + A.name

SQL Anywhere

SELECT b.name + '.' + a.name
  FROM sysobjects a, sysusers b
 WHERE a.type = 'V'
   AND a.uid = b.uid
 ORDER BY b.name, a.name
SQL Query Tool Download
Download Free Trial!
18,269 KB - Version: 6.2.0

QweryBuilder is an SQL Editor and Query Tool. Its purpose is to make accessing information from a database simple, quick, accurate and efficient.

Work with your SQL Server, ASE, SQL Anywhere and Oracle databases in one single application.

"QweryBuilder is a great, easy to use tool, that is a part of my everyday programmer life."

Read More Testimonials
Copyright © 2008-2010 Werysoft Inc. All rights reserved.
SQL Query Tool | SQL Editor | Database Development Tool | SQL References | Testimonials