Hi,
What is SQL statement for getting all database table name from Database?
Thanks in advance.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Feb 15, 2012, 11:02 PM
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.
Satyapriya NayakPosted Feb 15, 2012, 1:14 AM
USE YourDBNameGO
SELECT *
FROM sys.Tables
GO
Thanks