Cloud Training (Online)




How to Get the List of User Tables in SQL Server?

If you need to retrieve the list of the tables created by the users in SQL Server, you can do that easily by querying the sys.objects table.

How to Get the List of User Tables in SQL Server?

For example, the below query would display the list of tables and the type from the SQL Server.

select name,type 
from sys.objects 
order by name

How to Get the List of User Tables in SQL Server?

If we observe the type column , we could notice that it has the values “U” or “SQL” …

The rows with the type “U” are the tables created by the users. Simply filtering the records with the type = “U” would display the tables created by the user.

select name,type 
from sys.objects
where type='U'
order by name
Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.