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

When dealing with a relational database management system (RDBMS) like SQL Server, compatibility level is an important concept to understand....
In this blog post, let’s learn about the error message “49975 – Unable to load controller client certificate due to...
In this blog post, let’s learn about the error message “49973 – Cannot remove tempdb remote file to local tempdb...