Geeks With Blogs

News


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done
SQL Server:
 

SELECT

sysobjects.name as "Table",

syscolumns.name as "Column"

from sysobjects  , syscolumns

where sysobjects.id = syscolumns.id

and sysobjects.xtype = 'u'

and syscolumns.name like '%YourFieldNameGoesHere%'

order by sysobjects.name, syscolumns.name

 

----------------------------------------

--Get Table names and Row Counts

----------------------------------------

SELECT

    [TableAndCount] = so.name +' - '+CAST(MAX(si.rows)asvarchar(10))+' Rows'

    ,      [Name] = so.name

FROM

    sysobjects so,

    sysindexes si

WHERE so.xtype ='U'

    AND si.id =OBJECT_ID(so.name)

    and so.name notin('rvCustomer','rvOrder','sysdiagrams')

GROUP BY

    so.name

ORDER BY

    so.name

 

Sybase:

 

SELECT
sysobjects.name
as "Table"
,syscolumns.name
as "Column"
,sysobjects.type
from sysobjects  , syscolumns
where sysobjects.id = syscolumns.id
and sysobjects.type = 'U'
and syscolumns.name like '% YourFieldNameGoesHere %'
order by sysobjects.name, syscolumns.name
 

 

Posted on Saturday, July 15, 2006 2:47 PM SQL Server 2005 Tricks , SQL Server 2000 Tricks , Oracle | Back to top


Comments on this post: Find any datasbase Column by partial Name in any User Table

# re: Find any datasbase Column by partial Name in any User Table
Requesting Gravatar...
Nationwide bridal salon offers bridal and wedding gowns, bridesmaid dresses,
flower girl dresses, tuxedos, and other special occasion apparel. Site includes a bridal
wedding dresses
Left by G on Mar 29, 2010 12:37 AM

# re: Find any datasbase Column by partial Name in any User Table
Requesting Gravatar...
great,thanks,wish all the best
Left by sazky on Apr 22, 2010 11:50 AM

# re: Find any datasbase Column by partial Name in any User Table
Requesting Gravatar...
Windows is still the most used operating system on Feiteng Android Phone
Left by weng on Oct 30, 2012 2:13 AM

# re: Find any datasbase Column by partial Name in any User Table
Requesting Gravatar...
There is a good deal of excellent information in this article. I’m opting-in to your rss feed
Left by Jordan Shoes on Mar 02, 2013 12:18 AM

Your comment:
 (will show your gravatar)


Copyright © Rodney Vinyard | Powered by: GeeksWithBlogs.net