Hi,
What is SQL statement for getting all database table name from Database?
Thanks in advance.
SQL statement for getting all tables name
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 14, 2012, 8:14 PM EST
USE YourDBNameGO
SELECT *
FROM sys.Tables
GO
Thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 15, 2012, 6:02 PM EST
select * from sys.objects where type='U' and type_desc='USER_TABLE'
using type description use can also fine view, sp ,ect in sql
use type-Desc
SYSTEM_TABLE
VIEW
SQL_TABLE_VALUED_FUNCTION
DEFAULT_CONSTRAINT
SQL_STORED_PROCEDURE
FOREIGN_KEY_CONSTRAINT
SERVICE_QUEUE
SQL_INLINE_TABLE_VALUED_FUNCTION
USER_TABLE
PRIMARY_KEY_CONSTRAINT
INTERNAL_TABLE
TYPE_TABLE
SQL_TRIGGER
SQL_SCALAR_FUNCTION
UNIQUE_CONSTRAINT
hope this help.