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

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this blog post, let’s learn about the error message “1459 – An error occurred while accessing the database mirroring...
In this blog post, let’s learn about the error message “7937 – Columnstore index has one or more missing column...