A quick but interesting tool

This entry is for sql programmers really…

Have you ever wondered how many tables use on a particular column name?

Here’s a teeny script to figure it out:

select t.object_id, t.name as ‘table_name’, c.name as ‘column_name’
from sys.tables t
inner join sys.all_columns c
on c.object_id = t.object_id
where c.name like ‘%wbs1%’
order by t.name, c.name

Have fun!

Comments or questions for Loren?

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 )

Google+ photo

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

Connecting to %s