Often I need to find all the tables in Dynamics GP that have a particular column or search for all columns where I only have a partial column name. Over the years I have seen lots of different code to accomplish this, so this is nothing new. But I am asked about this enough that I thought I would share the code I use:
TABLE_NAME, COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH
WHERE TABLE_NAME in
WHERE xtype = 'U')
and COLUMN_NAME like '%xxxx%' -- replace with yours
ORDER BY COLUMN_NAME, TABLE_NAME
Just replace the xxxx with what you are looking for and run.
Updated on Jan 19, 2011 to add character maximum length.