Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to display the layouts for all the tables to see their columns? I am trying to find tables with a certain column names.

I am using the web app Web Data Administrator


- column 1
- column 2
- column 1

is there a way to get a display like that?

share|improve this question
Please use the edit button to clarify and improve your question to be more specific. – Paul White Nov 28 '12 at 2:32
edited with example :) – Julia Roberts Nov 28 '12 at 2:40
I still don't understand what you are looking for – billinkc Nov 28 '12 at 2:41
column my bad. that is what i meant then i think – Julia Roberts Nov 28 '12 at 3:06
up vote 9 down vote accepted

Here is a start, if I can guess that by row you actually mean column:

  [table]  = QUOTENAME(OBJECT_SCHEMA_NAME([t.object_id])) +'.'+ QUOTENAME(,
  [column] =
FROM sys.tables AS t
INNER JOIN sys.columns AS c
ON t.[object_id] = c.[object_id]
ORDER BY, c.column_id;

This doesn't provide exactly the output you want, but surely your presentation tier can - while it is looping through all of the rows - figure out to only list a table when it comes across a new one.

share|improve this answer
Yeah I would do something like this for ease of use, especially since you can do some filtering for names that are close to what you are looking for. – ConstantineK Nov 28 '12 at 2:56
select case when c_n is not null then '-' else t_n end, c_n 
from (
select t_n,c_n, ROW_NUMBER() over(order by t_n,c_n) rn 
from (
select table_name,column_name from INFORMATION_SCHEMA.columns
) X
) X
order by rn
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.