Board index » delphi » Searching MS SQL for tables containing a given string in their name
Clay Shannon
![]() Delphi Developer |
Searching MS SQL for tables containing a given string in their name2004-03-02 11:02:54 PM delphi181 I got this SQL from someone here a while back for finding all COLUMNS containing a given string from an MS SQL Server database: select sysobjects.Name As TableName, syscolumns.Name as ColumnName from sysobjects, syscolumns where sysobjects.id = syscolumns.id and sysobjects.xtype = 'U' and /* Tables Only ?*/ syscolumns.Name like 'WRBL_MCG' /* Name to search for */ order by sysobjects.Name, syscolumns.Name Can anyone tell me the SQL needed to find TABLE names containing a given string--does sysobjects.id get changed to systables.id or some such? Also, regarding xtype: what does 'U' mean, and what other values are available? -- Clay Shannon, author of the novel "the Wacky Misadventures of Warble McGorkle" www.booksurge.com/author.php3 |