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
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply


x

Interesting BlogPosts to read

Column Alias and Square brackets in SQL Query.
When we want to specify a alias for a column in SQL Query , we tend to use the double quotes or sing...
How to get the MAX row with group by in LINQ query using C# ?
Below is a sample code snippet demonstrating how to retreive the max row with the group by in LINQ Q...
Webinar - The Shortcomings of SQL for SharePoint Sync
Redmond Magazine is hosting a webinar on the topic "The Shortcomings of SQL for SharePoint Sync" on ...