Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 return table names from database

Author  Topic 

sqluserid
Starting Member

3 Posts

Posted - 2007-09-08 : 12:04:53
Hello,
How do you return the name of all the tables in a given database?

Thanks!

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-09-08 : 12:08:01
Run sp_tables or query information_schema.tables or query sysobjects for type = 'u' objects.
Go to Top of Page

sqluserid
Starting Member

3 Posts

Posted - 2007-09-08 : 12:31:26
?
Go to Top of Page

sqluserid
Starting Member

3 Posts

Posted - 2007-09-08 : 12:39:34
Thank you! I got it.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2007-09-08 : 13:57:53
or select name from sys.tables

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -