how Do I list all table names in SQL Server using T-SQL?

Posted by shrimpy on Stack Overflow See other posts from Stack Overflow or by shrimpy
Published on 2010-03-16T17:51:40Z Indexed on 2010/03/16 18:01 UTC
Read the original article Hit count: 190

Filed under:
|
|
SELECT name FROM sys.databases  -- this can list all database name in the server


user database
SELECT * FROM INFORMATION_SCHEMA.TABLES  
     -- these two line can list the table for one particular database 

But how can I output the results like below?

Database              Table
---------             -------------
db1                    t1
db1                    t2
db2                    t1
...                    ...

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-server-2005