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)
 Find all DB objects containing a given string

Author  Topic 

tjams
Starting Member

8 Posts

Posted - 2007-01-09 : 13:36:41
Hi,

I'm trying to figure out how to query to find the textual definitions of all DB objects containing a given string. IN SQL 2000, you could find these in syscomments, but the new sys.syscomments view does not contain table definitions. Anybody have any ideas? Or, if I must search for table definitions separately from other objects, what's the best way to do that?

Thanks in advance,
Tom

Kristen
Test

22859 Posts

Posted - 2007-01-09 : 13:44:53
You are probably best off changing to use the Information Schema Views which are less system-dependant.

e.g. SELECT TOP 10 * FROM INFORMATION_SCHEMA.ROUTINES

See BoL for more info.

Kristen
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-01-09 : 15:14:03
if you have to search table defs, you can't do it easily in sql. one way is to script out all objects and then search the scripts using findstr. you can script ALL objects out using this:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=73884

also you could use sqlspec to generate a chm and search that - chms are searchable by any keyword.




www.elsasoft.org
Go to Top of Page
   

- Advertisement -