How can display all table name in a Database ?

Hi,

I want to know that "how many tables are active in my database" by a single query in SQL server.

Last updated:9/21/2018 3:56:00 AM

1 Answers

Anonymous User
Anonymous User

Hi,

Rahul Ji,

I am giving you some database query, I hope that it will help you.

These are my database and table.

How can display all table name in a Database ?

Display All Table name in a Data Base at a time.

1). SELECT* FROM sys.Tables 

How can display all table name in a Database ?

2). SELECT*FROM information_schema.tables

How can display all table name in a Database ?

3). sp_tables '%cust%'             --------(search table)

How can display all table name in a Database ?

4). SELECT * FROM sys.Tables WHERE name LIKE '%cus%'

How can display all table name in a Database ?

5). SELECT * FROM information_schema.tables WHERE table_name LIKE '%cust%'

How can display all table name in a Database ?


Answer