Friday, May 23, 2014

SQL Commands

Here is an example of data that was pulled from the AdventureWorks database.  This data was pulled using this query:
SELECT * FROM INFORMATION_SCHEMA.TABLES

To only show a list of tables you would use this query:
SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE
 TABLE_TYPE = 
'BASE TABLE'

To only show a list of only the view you would use this query:
SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE
 TABLE_TYPE = 
'VIEW'

No comments:

Post a Comment