List all tables in a database

If you ever have the need to list all tables in your database, here is a statement that you can use.
I find it helpful if you need to loop through all the tables in your database or sometimes I need to provide a list to someone else.  I have used this script when moving changes between environments as a quick check to make I didn’t forget table.s

There are many different reasons you may need a list tables.

This will return just the table name. 

SELECT name AS TABLE_NAME 
FROM sys.tables WHERE (type = N'U') AND (LEFT(name, 1) = N't')
ORDER BY name

posted @ Friday, October 4, 2013 11:22 AM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 8 and 7 and type the answer here:
 

Live Comment Preview: