SQL Server Code,Tips and Tricks, Performance Tuning
A blog about SQL Server, Books, Movies and life in general
Google Interview Questions
|
Microsoft SQL Server Books
|
personal blog
|
Ken Henderson Interview
|
Louis Davidson Interview
|
Philately and Stamp Collecting
The Daily ChatGPT blog posts
Thursday, October 06, 2005
How to find all the tables and views in a database
Use the code below
USE
PUBS
GO
--Get All Tables
SELECT
*
FROM
INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE =
'BASE TABLE'
GO
--Get All Views
SELECT
*
FROM
INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE =
'VIEW'
GO
That's all, plain and simple
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment