List All Tables, Views - Sql Server

Feb 20, 2019 BY xtreme

list all tables 

All Tables In Sql 2000
SELECT NAME FROM sysobjects WHERE xtype='U'

All Tables In Sql 2005 and above
SELECT TABLE_NAME FROM .INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'


list all views

All Views In Sql 2000
SELECT NAME FROM sysobjects WHERE xtype='V'

All Views In Sql 2005 and above
SELECT TABLE_NAME FROM .INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'VIEW'





Related