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
 General SQL Server Forums
 New to SQL Server Programming
 Script to Query TableNames in Database?

Author  Topic 

childsce
Starting Member

4 Posts

Posted - 2007-02-12 : 12:54:53
Does anyone know a simple script that I can run to lookup a certain database and show me all the table names in the database??

Thanks anyone

childsce
Starting Member

4 Posts

Posted - 2007-02-12 : 13:11:29
hey never mind I got it.

Here it is in case anyone else needs it.

select * from information_schema.tables
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-12 : 13:15:32
sp_msforeachtable 'print ''?'''


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

childsce
Starting Member

4 Posts

Posted - 2007-02-12 : 14:28:46
What does that do??
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-12 : 14:37:33
It shows you all the table names in the database.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -