Search code examples
sql-server-2000sysobjects

In SQL Server 2000, is there a sysobjects query that will retrieve user views and not system views?


Assuming such a query exists, I would greatly appreciate the help.

I'm trying to develop a permissions script that will grant "select" and "references" permissions on the user tables and views in a database. My hope is that executing the "grant" commands on each element in such a set will make it easier to keep permissions current when new tables and views are added to the database.


Solution

  • select * from information_schema.tables
    WHERE OBJECTPROPERTY(OBJECT_ID(table_name),'IsMSShipped') =0 
    

    Will exclude dt_properties and system tables

    add

    where table_type = 'view' 
    

    if you just want the view