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 2000 Forums
 SQL Server Development (2000)
 SELECT in all tables

Author  Topic 

CLages
Posting Yak Master

116 Posts

Posted - 2004-09-02 : 18:53:31
Hi , how can i do a select in all tables

the problems is, i would like to search a name in a Database that has
around 900 tables.

then i am looking for a way to search in all tables for a specific
name.

Is it possible?

tks
any hlp will be apreciated
Carlos Lages

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-02 : 19:10:55
SELECT 'SELECT * FROM ' + name
FROM sysobjects
WHERE type = 'U'

Then copy the output to a new window and run it. Add a WHERE clause if you need to.

Tara
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-09-03 : 17:20:44
Search the data in all the tables for <name>
Or search the database catalog for all tables/columns/sprocs with <name> ?

rockmoose
/* Chaos is the nature of things...Order is a lesser state of chaos */
Go to Top of Page
   

- Advertisement -