Get Record all table name with specific column and its all information from the database

SELECT so.name , column_name ‘Column Name’,
data_type ‘Data Type’,
CHARacter_maximum_length ‘Maximum Length’
FROM information_schema.columns sc
inner join sysobjects so on sc.TABLE_NAME = so.name
where so.xtype =’U’ and (sc.COLUMN_NAME like ‘%columnName%’)
order by so.name,sc.COLUMN_NAME asc

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.