SQL SERVER Query to get all table name exist in database | Code By Topic

SQL SERVER Query to get all table name exist in database

Get all table name exist in database SQL Server
Suppose we are working on a large database in SQL Server structure which have lots of table then some time we forgot the table name or we remember only few word of the particular table then how we get all table name of the particular database its because some time its necessary to find out the all table name which are exist in our database.
Here i provide you query for fetching the all table name of a particular database. I am using here sql server sys objects and also sys.tables .

sql query to display all tables in a database

SELECT * FROM sys.objects where type='u'

Another query is 

SELECT * FROM sys.tables

For example : if you are use database NorthWind and after that you execute above  query then you get all the table name existing in this database & output like below.

Note : All query tested in SQL Server 2008R2

If you want to get some specific table name however you remember partially table name .Then Query is

SELECT * FROM sys.objects where type='u' and name like '%custorder%'


Post a Comment